This is an old revision of the document!
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.
This node has no craft recipe.
2019-01-01 15:00:00: WARNING[Server]: [advtrains]500000 ATC command parse error: Unknown command: malformed ATC 1
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:
Execution of the ATC command continues immediately.
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 Advtrains speed unit.
Execution of the ATC command continues immediately.
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.
Reverses movement direction of train. Has only effect while the train is standing.
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.
Execution of the ATC command continues immediately.
Close doors previously opened by OL or OR.
Advtrains only supports the if conditional statement. Such statements are expressed as follows:
I<condition><code>;
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:
2019-01-01 15:00:00: WARNING[Server]: Undeclared global variable “id” accessed at /home/username/.minetest/mods/advtrains/advtrains/atc.lua:274
2019-01-01 15:00:00: WARNING[Server]: [advtrains]nil ATC command syntax error: I statement not closed: I+S2 1
If you want to add an else branch, you can use this variant:
I<condition><ifcode>E<elsecode>;
Tests whether the train is driving in the right direction. + becomes true when it drives in direction of arrow; otherwise it is false. - is the opposite of +.
Compares the current train speed to the given speed. That speed should be a number constituted only of digits, representing an Advtrains speed unit.
It is not currently possible to test directly the speed for equality or inequality.
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.