User Tools

Site Tools


usage:nodes:atc_controller

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
Next revision Both sides next revision
usage:nodes:atc_controller [2019-07-02 11:52]
82.67.173.193
usage:nodes:atc_controller [2019-07-02 12:30]
82.67.173.193
Line 6: Line 6:
  
 ===== Properties ===== ===== Properties =====
-Mod: **advtrains_train_track** \\  +Mod: ''advtrains_train_track'' \\  
-Node name: **advtrains:dtrack_atc_placer** \\ +Node name: ''advtrains:dtrack_atc_placer'' \\ 
 Other names: Other names:
-  * **advtrains:dtrack_atc_st** +  * ''advtrains:dtrack_atc_st'' 
-  * **advtrains:dtrack_atc_st_30** +  * ''advtrains:dtrack_atc_st_30'' 
-  * **advtrains:dtrack_atc_st_45** +  * ''advtrains:dtrack_atc_st_45'' 
-  * **advtrains:dtrack_atc_st_60**+  * ''advtrains:dtrack_atc_st_60''
  
 ===== Craft recipe ===== ===== Craft recipe =====
Line 32: Line 32:
  
 ===== ATC command syntax ===== ===== ATC command syntax =====
 +
 +In ATC commands, spaces are ignored and can be inserted as needed.
 +
 ==== Simple directives ==== ==== Simple directives ====
 === S<speed> === === S<speed> ===
  
-Sets the target speed of driving train to **<speed>**. The train accelerates if faster than current speed, rolls if slower, and does nothing if at the same speed.+Sets the target speed of driving train to ''<speed>''. The train accelerates if faster than current speed, rolls if slower, and does nothing if at the same speed.
  
-**<speed>** can be either:+''<speed>'' can be either:
   * a number constituted only of digits. This represents an [[usage:trains#advtrains_speed_unit|Advtrains speed unit]], or   * a number constituted only of digits. This represents an [[usage:trains#advtrains_speed_unit|Advtrains speed unit]], or
   * the special value **M**, which represents the maximal speed of the train as defined by the entity definition passed to [[reference:advtrains:register_wagon|advtrains.register_wagon]].   * the special value **M**, which represents the maximal speed of the train as defined by the entity definition passed to [[reference:advtrains:register_wagon|advtrains.register_wagon]].
Line 45: Line 48:
 === B<speed> === === B<speed> ===
  
-Brakes until the train speed reaches **<speed>**. The train applies brakes if slower than current speed, and does nothing if not.+Brakes until the train speed reaches ''<speed>''. The train applies brakes if slower than current speed, and does nothing if not.
  
-**<speed>** should be a number constituted only of digits, representing an [[usage:trains#advtrains_speed_unit|Advtrains speed unit]].+''<speed>'' should be a number constituted only of digits, representing an [[usage:trains#advtrains_speed_unit|Advtrains speed unit]].
  
 Execution of the ATC command continues **immediately**. Execution of the ATC command continues **immediately**.
Line 53: Line 56:
 === W === === W ===
  
-Pauses execution of the ATC command until **S** and **B** directives reached the desired speed.+Pauses execution of the ATC command until ''S'' and ''B'' directives reached the desired speed.
  
 **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 63: Line 66:
 === 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 "right" direction being when you placed the rail towards driving direction), the **OL** command will open right doors compared to driver perspective.+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 "right" direction being when you placed the rail towards driving direction), the ''OL'' command will open right doors compared to driver perspective.
  
-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 ''OL'', however, you will not be able to open right doors using ''OR'', and vice-versa.
  
 Execution of the ATC command continues **immediately**. Execution of the ATC command continues **immediately**.
Line 71: Line 74:
 === OC === === OC ===
  
-Close doors previously opened by **OL** or **OR**.+Close doors previously opened by ''OL'' or ''OR''.
  
 ==== Conditional statements ==== ==== Conditional statements ====
Line 77: Line 80:
 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<condition><code>;**+''I<condition><code>;''
  
-where **<condition>** is one of the conditions described below, and **<code>** is a regular ATC command.+where ''<condition>'' is one of the conditions described below, and ''<code>'' is a regular ATC command.
 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 90:
 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<condition><ifcode>E<elsecode>;**+''I<condition><ifcode>E<elsecode>;''
  
 === +, - === === +, - ===
Line 102: Line 105:
 === S, B === === S, B ===
  
-  * **SM**: accelerate to maximum speed +  * ''SM'': accelerate to maximum speed 
-  * **S2**: set target speed to 2 (~ 8 km/h) +  * ''S2'': set target speed to 2 (~ 8 km/h) 
-  * **S0**: roll to stand +  * ''S0'': roll to stand 
-  * **B0**: brake to stand +  * ''B0'': brake to stand 
-  * **S0 B3** or **B3S0**: brake to 3, then roll to stand.+  * ''S0 B3'' or ''B3 S0'': brake to 3, then roll to stand.
  
 === W, R === === W, R ===
  
-  * **S5 W**: set target speed to 5 (~ 18 km/h), and wait for speed to be 5 +  * ''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 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 after the train stopped, and reverse direction of train+  * ''B0 W D10 SM'': brake to stand, wait 10 seconds after the train stopped, and reverse direction of train
  
 === 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 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+  * ''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 + 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 + 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+  * ''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 (''static''''mesecon'' and ''digilines''), only the static mode is supported. It is actually not possible to change directly the mode from the ATC controller.
   * The ATC controller rail has the same texture as the [[usage:nodes:atc_rail|LuaAutomation ATC rail]], but its functions are different.   * The ATC controller rail has the same texture as the [[usage:nodes:atc_rail|LuaAutomation ATC rail]], but its functions are different.
  
usage/nodes/atc_controller.txt · Last modified: 2022-06-27 04:32 by blockhead