Vehicle control
This chapter describes the actions you have to control your trains. For better overview we separate them into different categories for speed, direction and function.
Select
Any of the vehicle control functions (either speed, direction or function) requires you to have selected a locomotive in a previous action. The select action requires you to configure the name and address of the vehicle you want to control. You don't have to enter them manually, you can use the catalog selector you can easily select a previously configured vehicle.
Another possibility is to use the select from feedback action. In this case you can select a feedback module from your layout and Model Train Script will select the first locomotive detected from that feedback module. This feature does require RailCom.
Speed
A stop action does not require any configuration. Its function is to stop the currently selected locomotive. The set speed allows you to modify the speed of the currently selected locomotive. The speed is defined in percentage, 0 being stopped and 100 meaning full speed.
Direction
A toggle action does not require any configuration. It changes the direction to the opposite as the current direction of travel. With a set direction you have more control and you can specify the direction of travel for the currently selected locomotive.
Functions
The set function allows you to trigger a specific function of the currently selected vehicle. There are two ways of doing this. You can select the function by index or by icon.
By icon Model Train Script selects the first function of the active vehicle with the configured icon. This allows you to create vehicle independent scripts.
By function gives you more control by specifying the exact function you want to use. You don't have to enter the information manually as you can select them from a previously configured vehicle via the select from catalog option.
State
With store and restore you can at any moment in the script store the current state of the active vehicle to restore it a later point. A use case can be be a low speed section, before entering the section you store the state, than set the state to a specific speed. After the train exits the low speed section you can restore the vehicle state to resume normal speed.
Last updated
Was this helpful?