This shows you the differences between two versions of the page.
Both sides previous revision Previous revision Next revision | Previous revision | ||
usage:nodes:atc_controller [2019-07-02 11:52] 82.67.173.193 |
usage:nodes:atc_controller [2022-06-27 04:32] (current) blockhead [Speed commands] grammar |
||
---|---|---|---|
Line 1: | Line 1: | ||
====== ATC controller ====== | ====== ATC controller ====== | ||
- | {{ http:// | + | {{ :usage: |
//Unleash the full power of Advtrains by sending Automatic Train Control commands.// | //Unleash the full power of Advtrains by sending Automatic Train Control commands.// | ||
- | //Note: this page has been written for Advtrains 2.0.1 TSS and Minetest 5.1.0. Examples and practices described in this page don't take advantage of improvements introduced in later releases.// | + | //Note: this page has been written for Advtrains 2.1.0 and Minetest 5.1.0. Examples and practices described in this page don't take advantage of improvements introduced in later releases.// |
===== Properties ===== | ===== Properties ===== | ||
- | Mod: **advtrains_train_track** \\ | + | Mod: '' |
- | Node name: **advtrains: | + | Node name: '' |
Other names: | Other names: | ||
- | * **advtrains: | + | * '' |
- | * **advtrains: | + | * '' |
- | * **advtrains: | + | * '' |
- | * **advtrains: | + | * '' |
===== Craft recipe ===== | ===== Craft recipe ===== | ||
Line 32: | Line 32: | ||
===== ATC command syntax ===== | ===== ATC command syntax ===== | ||
- | ==== Simple directives | + | |
+ | In ATC commands, spaces are ignored and can be inserted as needed. | ||
+ | |||
+ | ==== Speed commands | ||
=== S< | === S< | ||
- | Sets the target speed of driving train to **< | + | Sets the target speed of driving train to '' |
- | **< | + | '' |
- | * a number constituted only of digits. This represents | + | * a number constituted only of digits. This represents |
- | * the special value **M**, which represents the maximal speed of the train as defined by the entity definition passed to [[reference:advtrains: | + | * the special value **M**, which represents the maximal speed of the train as defined by the entity definition passed to [[dev:core:funref: |
Execution of the ATC command continues **immediately**. | Execution of the ATC command continues **immediately**. | ||
Line 45: | Line 48: | ||
=== B< | === B< | ||
- | Brakes until the train speed reaches | + | Brakes until the train speed reaches |
- | **< | + | '' |
+ | |||
+ | Execution of the ATC command continues **immediately**. | ||
+ | |||
+ | === BB === | ||
+ | |||
+ | Activates the emergency brake. In this mode, the deceleration is higher than with standard brake (i.e. '' | ||
Execution of the ATC command continues **immediately**. | Execution of the ATC command continues **immediately**. | ||
Line 53: | Line 62: | ||
=== W === | === W === | ||
- | Pauses execution of the ATC command until **S** and **B** directives reached the desired speed. | + | Pauses execution of the ATC command until '' |
**Please use with caution. If the train is never able to reach the desired speed, this directive will probably break your ATC command.** | **Please use with caution. If the train is never able to reach the desired speed, this directive will probably break your ATC command.** | ||
Line 60: | Line 69: | ||
Reverses movement direction of train. Has only effect while the train is standing. | Reverses movement direction of train. Has only effect while the train is standing. | ||
+ | |||
+ | ==== Door commands ==== | ||
=== OL, OR === | === OL, OR === | ||
- | Open left or right doors. Whether doors are left or right are relative to ATC controller arrow direction. So if you try to drive in wrong direction (the " | + | Open left or right doors. Whether doors are left or right are relative to ATC controller arrow direction. So if you try to drive in wrong direction (the " |
- | If you open left doors with **OL**, however, you will not be able to open right doors using **OR**, and vice-versa. | + | If you open left doors with '' |
Execution of the ATC command continues **immediately**. | Execution of the ATC command continues **immediately**. | ||
Line 71: | Line 82: | ||
=== OC === | === OC === | ||
- | Close doors previously opened by **OL** or **OR**. | + | Close doors previously opened by '' |
+ | |||
+ | === K === | ||
+ | |||
+ | Kicks all passengers (except drivers) out of the train. Door must be opened to do this. Useful at terminal stations. | ||
+ | |||
+ | ==== Other Commands ==== | ||
+ | |||
+ | === Cpl === | ||
+ | |||
+ | Temporarily switch the train to " | ||
+ | |||
+ | This command makes the train continue at its current speed until it hits another standing wagon or train. Then, it couples to this train and ATC command execution continues. | ||
+ | |||
+ | After coupling, the train retains its current target speed. If you do not include a '' | ||
+ | |||
+ | **Note to LuaATC users:** When using this command, the train running the ATC command is guaranteed to retain its Train ID. The Train ID of the standing train that it is coupled to becomes invalid. | ||
+ | |||
+ | //Note: This command is unique in that its command code is a 3-letter code. Future ATC extensions should also introduce multi-letter codes to avoid exhaustion of letter space for single-letter codes.// | ||
==== Conditional statements ==== | ==== Conditional statements ==== | ||
Line 77: | Line 106: | ||
Advtrains only supports the **if** conditional statement. Such statements are expressed as follows: | Advtrains only supports the **if** conditional statement. Such statements are expressed as follows: | ||
- | **I< | + | '' |
- | where **< | + | where '' |
Notice the semi-colon which is required, otherwise you get two warnings like this: | Notice the semi-colon which is required, otherwise you get two warnings like this: | ||
Line 87: | Line 116: | ||
If you want to add an else branch, you can use this variant: | If you want to add an else branch, you can use this variant: | ||
- | **I< | + | '' |
=== +, - === | === +, - === | ||
Line 95: | Line 124: | ||
=== <, <=, >, >= === | === <, <=, >, >= === | ||
- | Compares the current train speed to the given speed. That speed should be a number constituted only of digits, | + | Compares the current train speed to the given speed. That speed should be a number constituted only of digits, |
It is not currently possible to test directly the speed for equality or inequality. | It is not currently possible to test directly the speed for equality or inequality. | ||
- | ==== Examples ==== | + | Although there is no direct command, it is possible to use nested conditional commands to test for equality or inequality: |
- | === S, B === | + | < |
+ | I<8 | ||
+ | Not equal to 8 | ||
+ | E | ||
+ | | ||
+ | Not equal to 8 | ||
+ | E | ||
+ | Equal to 8 | ||
+ | ;; | ||
+ | </ | ||
+ | |||
+ | Unfortunately the command < | ||
+ | |||
+ | ==== Specific commands ==== | ||
+ | |||
+ | === A< | ||
+ | Either enables ('' | ||
+ | When disabled, the train will not trigger automatic route setting on signals based on ARS. | ||
+ | |||
+ | **This command is available only in the '' | ||
+ | |||
+ | ===== Examples | ||
+ | |||
+ | ==== S, B ==== | ||
+ | |||
+ | * '' | ||
+ | * '' | ||
+ | * '' | ||
+ | * '' | ||
+ | * '' | ||
+ | |||
+ | ==== W, R ==== | ||
- | * **SM**: accelerate to maximum speed | + | * '' |
- | * **S2**: set target speed to 2 (~ 8 km/h) | + | * '' |
- | * **S0**: roll to stand | + | * '' |
- | * **B0**: brake to stand | + | |
- | * **S0 B3** or **B3S0**: brake to 3, then roll to stand. | + | |
- | === W, R === | + | ==== Cpl ==== |
- | * **S5 W**: set target speed to 5 (~ 18 km/h), and wait for speed to be 5 | + | * '' |
- | * **B0 W R**: brake to stand, wait for speed to be 0, and reverse direction of train | + | |
- | * **B0 W D10 SM**: brake to stand, wait 10 seconds | + | |
- | === OL, OR, OC === | + | ==== OL, OR, OC ==== |
- | * **B0 W OL D10 OC D1 SM**: example of train stopping at a standard station with doors opening on the left | + | * '' |
- | * **B0 W OL R D20 OC D1 SM**: example of train stopping at a terminus station, with returning in opposite direction | + | * '' |
- | === I, +/-, </< | + | ==== I, +/-, </< |
- | * **I + S2;**: if the train is going in the right direction, set target speed to 2 | + | * '' |
- | * **I + SM E B0;**: if the train is going in the right direction, accelerate, otherwise stop | + | * '' |
- | * **I <8 S8;**: if the train is slower than 8 (~ 30 km/h), set target speed to 8 | + | * '' |
===== Trivia ===== | ===== Trivia ===== | ||
- | * Although the node has three different modes (**static**, **mesecon** and **digilines**), only the static mode is supported. It is actually not possible to change directly the mode from the ATC controller. | + | * Although the node has three different modes ('' |
* The ATC controller rail has the same texture as the [[usage: | * The ATC controller rail has the same texture as the [[usage: | ||