From c0957b8a31df8484436e204b14b5d6d0d08a2eaa Mon Sep 17 00:00:00 2001 From: orwell96 Date: Wed, 4 Jan 2017 21:49:16 +0100 Subject: also print ATC reverse command warning and move atc_command.txt at a better place --- advtrains.zip | Bin 4437952 -> 4437929 bytes advtrains/advtrains/atc.lua | 2 +- advtrains/advtrains/atc_command.txt | 68 ------------------------------------ advtrains/atc_command.txt | 68 ++++++++++++++++++++++++++++++++++++ 4 files changed, 69 insertions(+), 69 deletions(-) delete mode 100644 advtrains/advtrains/atc_command.txt create mode 100644 advtrains/atc_command.txt diff --git a/advtrains.zip b/advtrains.zip index b934318..0230ca8 100644 Binary files a/advtrains.zip and b/advtrains.zip differ diff --git a/advtrains/advtrains/atc.lua b/advtrains/advtrains/atc.lua index 1b7ba5a..2bc07be 100644 --- a/advtrains/advtrains/atc.lua +++ b/advtrains/advtrains/atc.lua @@ -190,7 +190,7 @@ local matchptn={ train.movedir=train.movedir*-1 train.atc_arrow = not train.atc_arrow else - atprint("ATC Reverse command warning: didn't reverse train!") + minetest.chat_send_all("ATC Reverse command warning: didn't reverse train!") end return 1 end, diff --git a/advtrains/advtrains/atc_command.txt b/advtrains/advtrains/atc_command.txt deleted file mode 100644 index fa846e3..0000000 --- a/advtrains/advtrains/atc_command.txt +++ /dev/null @@ -1,68 +0,0 @@ -ATC Command Syntax - -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. -Spaces can be inserted into commands as needed and are ignored. - -# simple commands: - -S<[0-9]+ speed or 'M'> -Set target speed of train to . Accelerates if slower, rolls if faster. 'M' means maximum speed. -Execution of command continues immediately. - -B<[0-9]+ speed> -Brake until speed is reached. If faster, apply brakes, if slower, do nothing. -Execution of command continues immediately. - -Examples: -SM : accelerate to maximum speed -S0 : roll to stand -B0 : brake to stand -S0B3 or B3S0: brake to 3, then roll to stand. - -W -Wait until S and/or B commands reached the desired speed before continuing execution. - -D<[0-9]+ time> -Delay: Wait for time seconds before continuing execution. - -R -Reverse: change movement direction of train. ONLY WORKS WHEN TRAIN STANDS, else no-op. -Use B0WR to definitely change direction. - -Examples: -B0 W R D10 SM -Subway train stopping in dead end station and returning in opposite direction - -# conditional statements: - -I; -Execute code only if condition applies -IE; -Execute code1 only if condition applies, else execute code2 - -Conditions: -+ / - -Tests the train's movement direction against the arrow on the ATC rail: M+ is true when train drives in direction of arrow. - -[/<=/>=][speed] -Test if train's speed is greater or smaller than the given value - -Examples: -I- B0 W R ; S8 -If the train drives in the 'wrong' direction, stop and reverse; independently accelerate to speed 8 afterwards. - -I<8 S8 ; -If the train is slower than 8, accelerate to 8. - -# ATC controller operation modes -static: Only give 1 static command. -mesecon: Give 2 different commands depending on if the controller is mesecon-powered or not -digiline: Don't give any commands by itself. When a train passes, a digiline message in the form of "[+/-][speed]" is sent on the set channel (where +/- means the same as with conditions). Any digiline message sent to the controller will be interpreted as ATC command and sent to the train. - -# Persistence -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. - -# LUA ATC controller (in development) -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. -Also planned: -- digicompute add-on to allow computer access to the ATC environment (railway maps... ... ... ... ...) diff --git a/advtrains/atc_command.txt b/advtrains/atc_command.txt new file mode 100644 index 0000000..fa846e3 --- /dev/null +++ b/advtrains/atc_command.txt @@ -0,0 +1,68 @@ +ATC Command Syntax + +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. +Spaces can be inserted into commands as needed and are ignored. + +# simple commands: + +S<[0-9]+ speed or 'M'> +Set target speed of train to . Accelerates if slower, rolls if faster. 'M' means maximum speed. +Execution of command continues immediately. + +B<[0-9]+ speed> +Brake until speed is reached. If faster, apply brakes, if slower, do nothing. +Execution of command continues immediately. + +Examples: +SM : accelerate to maximum speed +S0 : roll to stand +B0 : brake to stand +S0B3 or B3S0: brake to 3, then roll to stand. + +W +Wait until S and/or B commands reached the desired speed before continuing execution. + +D<[0-9]+ time> +Delay: Wait for time seconds before continuing execution. + +R +Reverse: change movement direction of train. ONLY WORKS WHEN TRAIN STANDS, else no-op. +Use B0WR to definitely change direction. + +Examples: +B0 W R D10 SM +Subway train stopping in dead end station and returning in opposite direction + +# conditional statements: + +I; +Execute code only if condition applies +IE; +Execute code1 only if condition applies, else execute code2 + +Conditions: ++ / - +Tests the train's movement direction against the arrow on the ATC rail: M+ is true when train drives in direction of arrow. + +[/<=/>=][speed] +Test if train's speed is greater or smaller than the given value + +Examples: +I- B0 W R ; S8 +If the train drives in the 'wrong' direction, stop and reverse; independently accelerate to speed 8 afterwards. + +I<8 S8 ; +If the train is slower than 8, accelerate to 8. + +# ATC controller operation modes +static: Only give 1 static command. +mesecon: Give 2 different commands depending on if the controller is mesecon-powered or not +digiline: Don't give any commands by itself. When a train passes, a digiline message in the form of "[+/-][speed]" is sent on the set channel (where +/- means the same as with conditions). Any digiline message sent to the controller will be interpreted as ATC command and sent to the train. + +# Persistence +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. + +# LUA ATC controller (in development) +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. +Also planned: +- digicompute add-on to allow computer access to the ATC environment (railway maps... ... ... ... ...) -- cgit v1.2.3