Model Train Script
English
English
  • Model Train Script
  • About
  • Manual
    • Supported systems
    • Settings
    • Profile
    • Throttle
    • Vehicles
    • Layout
    • Automation
      • Scripts
        • Section
        • Action
          • Vehicle control
          • Layout control
          • Timing
          • Structure
          • Scenery
      • Time tables
      • Flags
      • Routes
      • Sounds
      • Cameras
      • Examples
        • Block control
        • Auto switch turnout
        • Camera detection
  • Release notes
Powered by GitBook
On this page
  • Scoping
  • Global
  • Script
  • Vehicle

Was this helpful?

  1. Manual
  2. Automation

Flags

Enabling dynamic behaviour of your scripts.

Last updated 2 months ago

Was this helpful?

Flags allow you to make your scripts more reusable and dynamic.

Flags can be used in conditions within scripts, sections or actions. A typical example use cases for flags is to enable/disable sounds for late night running sessions.

Scoping

To have a granuarly control of the flags you can scope them on three levels. Once a flag is set on any level you cannot disable it on another level.

During evaluation if a flag is active on any of these levels the condition is evaluated as true.

Global

When you enable/disable flags in the throttle you do this on a global scope: these flags will active for all scripts that are executed.

Script

With the "SetFlag" action you can enable a specific flag in your script: these flags will only be active for that specific script and only for that run.

Vehicle

You can enable flags to a specific vehicle: these flags will be active when a vehicle is selected in a script via the "SelectVehicle" action or via the "select active vehicle" option of the execution event or the "WaitFeedback" action. As soon as another vehicle is selected the flags of the previous vehicle are no longer active.

Example flag