atc_command.txt 3.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596
  1. ATC Command Syntax
  2. A train runs the current ATC command once it receives it, including delayed instructions. If the train receives a new command, the current command is discarded.
  3. Spaces can be inserted into commands as needed and are ignored.
  4. # simple commands:
  5. S<[0-9]+ speed or 'M'>
  6. Set target speed of train to <speed>. Accelerates if slower, rolls if faster. 'M' means maximum speed.
  7. Execution of command continues immediately.
  8. B<[0-9]+ speed>
  9. Brake until speed is reached. If faster, apply brakes, if slower, do nothing.
  10. Execution of command continues immediately.
  11. Examples:
  12. SM : accelerate to maximum speed
  13. S0 : roll to stand
  14. B0 : brake to stand
  15. S0B3 or B3S0: brake to 3, then roll to stand.
  16. W
  17. Wait until S and/or B commands reached the desired speed before continuing execution.
  18. D<[0-9]+ time>
  19. Delay: Wait for time seconds before continuing execution.
  20. R
  21. Reverse: change movement direction of train. ONLY WORKS WHEN TRAIN STANDS, else no-op.
  22. Use B0WR to definitely change direction.
  23. Examples:
  24. B0 W R D10 SM
  25. Subway train stopping in dead end station and returning in opposite direction
  26. OL
  27. Open left doors
  28. OR
  29. Open right doors
  30. OC
  31. Close Doors
  32. All door commands are relative to the arrow direction, so if a train drives to opposite arrow direction, L will open its right doors from driver perspective.
  33. Execution continues immediately, there is no way to wait for all doors to be opened/closed.
  34. Example:
  35. B0 W OL D10 OC D1 SM
  36. Subway train: stop in station and open doors, depart after 10 seconds.
  37. K
  38. Kick all passengers out of the trains
  39. This command kicks all passengers (non-driving players) off the train. This command works only
  40. if the train is stopped and its doors are open.
  41. Cpl
  42. Temporarily switch the train to "Autocouple" mode and wait for coupling.
  43. 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.
  44. # conditional statements:
  45. I<condition><code>;
  46. Execute code only if condition applies
  47. I<condition><code1>E<code2>;
  48. Execute code1 only if condition applies, else execute code2
  49. Conditions:
  50. + / -
  51. Tests the train's movement direction against the arrow on the ATC rail: M+ is true when train drives in direction of arrow.
  52. [</>/<=/>=][speed]
  53. Test if train's speed is greater or smaller than the given value
  54. Examples:
  55. I- B0 W R ; S8
  56. If the train drives in the 'wrong' direction, stop and reverse; independently accelerate to speed 8 afterwards.
  57. I<8 S8 ;
  58. If the train is slower than 8, accelerate to 8.
  59. # Interlocking
  60. With advtrains_interlocking, there's one more available command:
  61. A0
  62. Disable ARS on the train.
  63. A1
  64. Enable ARS on the train.
  65. When disabled, the train will not trigger automatic route setting on signals based on ARS.
  66. # Persistence
  67. ATC controllers that are configured as 'static' or 'mesecon' are persistent over mapblock unloads and will even command the train when the mapblock is unloaded. This is not possible with digilines since these do not work in unloaded mapchunks.
  68. # LUA ATC controller (in development)
  69. The LUA ATC Controller will operate by using LUA code. All operations shown above will have a function equivalent. Additionally all LUA ATC controllers share an environment and setting signal and switch status will be possible to allow for complicated railway systems/fully automated subways a.s.o.
  70. Also planned:
  71. - digicompute add-on to allow computer access to the ATC environment (railway maps... ... ... ... ...)