From 9a775eff5b7a49c322119feb4c8248791edab501 Mon Sep 17 00:00:00 2001 From: orwell96 Date: Mon, 24 Aug 2020 20:49:16 +0200 Subject: Add sign to make shunt moves proceed as main and improve doc of signals --- advtrains_interlocking/signal_api.lua | 21 ++++++++++++++------- advtrains_signals_ks/init.lua | 3 ++- .../textures/advtrains_signals_ks_sign_pam.png | Bin 0 -> 211 bytes 3 files changed, 16 insertions(+), 8 deletions(-) create mode 100644 advtrains_signals_ks/textures/advtrains_signals_ks_sign_pam.png diff --git a/advtrains_interlocking/signal_api.lua b/advtrains_interlocking/signal_api.lua index bf8622a..6ca6a90 100644 --- a/advtrains_interlocking/signal_api.lua +++ b/advtrains_interlocking/signal_api.lua @@ -3,17 +3,18 @@ --[[ Signal aspect table: +Note: All speeds are measured in m/s, aka the number of + signs in the HUD. asp = { main = , -- Main signal aspect, tells state and permitted speed of next section -- 0 = section is blocked -- >0 = section is free, speed limit is this value -- -1 = section is free, maximum speed permitted - -- false = Signal doesn't provide main signal information, retain current speed limit. + -- false/nil = Signal doesn't provide main signal information, retain current speed limit. shunt = , -- Whether train may proceed as shunt move, on sight -- main aspect takes precedence over this - -- When main==0, train switches to shunt move and is restricted to speed 8 + -- When main==0, train switches to shunt move and is restricted to speed 6 proceed_as_main = , -- If an approaching train is a shunt move and 'shunt' is false, -- the train may proceed as a train move under the "main" aspect @@ -29,7 +30,7 @@ asp = { -- 0 = section is blocked -- >0 = section is free, speed limit is this value -- -1 = section is free, maximum speed permitted - -- false = Signal doesn't provide distant signal information. + -- false/nil = Signal doesn't provide distant signal information. -- the character of call_on and dead_end is purely informative call_on = , -- Call-on route, expect train in track ahead (not implemented yet) @@ -63,10 +64,16 @@ advtrains = { -- This function gets called whenever the signal should display -- a new or changed signal aspect. It is not required that -- the signal actually displays the exact same aspect, since - -- some signals can not do this by design. - -- Example: pure shunt signals can not display a "main" aspect - -- and have no effect on train moves, so they will only ever - -- honor the shunt.free field for their aspect. + -- some signals can not do this by design. However, it must + -- display an aspect that is at least as restrictive as the passed + -- aspect as far as it is capable of doing so. + -- Examples: + -- - pure shunt signals can not display a "main" aspect + -- and have no effect on train moves, so they will only ever + -- honor the shunt.free field for their aspect. + -- - the german Hl system can only signal speeds of 40, 60 + -- and 100 km/h, a speed of 80km/h should then be signalled + -- as 60 km/h instead. -- In turn, it is not guaranteed that the aspect will fulfill the -- criteria put down in supported_aspects. -- If set_aspect is present, supported_aspects should also be declared. diff --git a/advtrains_signals_ks/init.lua b/advtrains_signals_ks/init.lua index 3559d51..08bbb75 100644 --- a/advtrains_signals_ks/init.lua +++ b/advtrains_signals_ks/init.lua @@ -174,7 +174,8 @@ for _, rtab in ipairs({ -- Speed restriction lifted ["e"] = {asp = { main = -1, shunt = true }, n = "hfs"}, -- Halt for shunt moves: - ["hfs"] = {asp = { main = false, shunt = false }, n = "8"}, + ["hfs"] = {asp = { main = false, shunt = false }, n = "pam"}, + ["pam"] = {asp = { main = -1, shunt = false, proceed_as_main = true}, n = "8"}, }) do minetest.register_node("advtrains_signals_ks:sign_"..typ.."_"..rot, { description = "Signal Sign", diff --git a/advtrains_signals_ks/textures/advtrains_signals_ks_sign_pam.png b/advtrains_signals_ks/textures/advtrains_signals_ks_sign_pam.png new file mode 100644 index 0000000..c4229fd Binary files /dev/null and b/advtrains_signals_ks/textures/advtrains_signals_ks_sign_pam.png differ -- cgit v1.2.3