From be2f37a0678c66278d1c491b8f1250a8a3be9feb Mon Sep 17 00:00:00 2001 From: ywang Date: Wed, 3 Nov 2021 18:55:31 +0100 Subject: Support different types of speed restrictions; add documentation --- .../doc/advtrains_signals_ks.7advtrains.md | 60 ++++++++++++++++++++++ advtrains_signals_ks/init.lua | 42 +++++++++++++++ 2 files changed, 102 insertions(+) create mode 100644 advtrains_signals_ks/doc/advtrains_signals_ks.7advtrains.md (limited to 'advtrains_signals_ks') diff --git a/advtrains_signals_ks/doc/advtrains_signals_ks.7advtrains.md b/advtrains_signals_ks/doc/advtrains_signals_ks.7advtrains.md new file mode 100644 index 0000000..a043343 --- /dev/null +++ b/advtrains_signals_ks/doc/advtrains_signals_ks.7advtrains.md @@ -0,0 +1,60 @@ +% advtrains_signals_ks(7advtrains) | Advtrains User Guide + +# NAME +`advtrains_signals_ks` - Ks signals for advtrains + +# DESCRIPTION + +This mod includes a modified subset of German rail signals. This page documents the signals implemented by this mod and some differences between this mod and German signals used in real life. The TODO section is currently included as there are notable modifications to this mod by the current `new-ks` branch, but it will be removed when the branch is ready for review. + +# SIGNAL ASPECTS + +This section mainly describes the different signal aspects. Please note that the meaning of some signal aspects may differ from their RL counterparts, and that the differences documented in the following section are not comprehensive. + +Due to historical reasons, "ex-DB" and "ex-DR" are used to refer to the former Deutsche Bundesbahn (West Germany) and the former Deutsche Reichsbahn (East Germany), respectively. + +## Ks signals +The Ks signals are used like most other signals in advtrains. It has the following aspects: + +* Hp 0 (red light): Stop +* Ks 1 (green light): Proceed at maximum speed or with the speed limit shown on the Zs 3 indicator directly above the signal (if present) and expect to proceed the next main signal at maximum speed or, if the green light is flashing, with the speed limit shown on the Zs 3v indicator directly below the signal +* Ks 2 (yellow light): Proceed at maximum speed or with the speed limit shown on the Zs 3 indicator directly above the signal (if present) and expect to stop in front of the next main signal. + +In addition, Sh 1 (see below) may also appear with Hp 0, in which case the train continues in shunt mode. + +## Shunt signals +Shunt signals are labeled "Ks Shunting signal" in-game. It has the following aspects: + +* Sh 0 (two horizontally aligned red lights): Stop +* Sh 1/(ex-DR) Ra 12 (two white lights aligned on a slanted line): shunting allowed + +## Signal signs +There are a few signal signs provided by this mod: + +* Lf 7 (black number on a white background): Proceed with the permanent speed limit shown on the sign +* Lf 1/2 (black number on a yellow background): Proceed with the temporary speed limit shown on the sign +* Lf 3 (black letter "E" on a yellow background): The temporary speed limit previously set by Lf 1/2 is lifted +* "E" signal (**not** Lf 3) (black letter "E" on a white background): Proceed at maximum speed +* Ra 10 (the black text "Halt für Rangierfahrten" on a white semicircle): Do not proceed if in shunt mode +* Proceed as main ("PAM", in-game only) ("S" below a green arrow): Proceed without shunt mode + +# DIFFERENCES FROM REAL-LIFE SIGNALS + +[This document](https://www.bahnstatistik.de/Signale_pdf/SB-DBAG.pdf) is used for reference, + +* The speed is indicated in m/s instead of multiples of 10km/h. +* Due to the potentially large number of nodes, only certain hard-coded values are allowed. +* Certain visual effects, such as making signal signs reflective or lit at night, are not implemented. +* The "E" sign, unlike Lf 3, lifts the main speed restriction as if by Hp 1. +* The actual Lf 3 has an orange background. +* Signal signs operate independently from other signals. +* Distant signaling is not yet implemented. +* The location of most signals are not checked. The location of Zs 3 and Zs 3v are only checked relative to the location of the main (Ks) signal. +* The "shunt signals" in this mod are actually known as "Schutzsignale". The word "Rangiersignale" refers to a different set of signals (including acoustic signals) given by the person specifically responsible for train shunting. +* The ex-DB definition of Sh 1 ("Fahrverbot aufgehoben") is that the track section ahead is clear and does not imply that the driver is allowed to proceed. +* @orwell noted on the Minetest forum that the function of Lf 7 in the mod should normally be done with Zs 3. + +# TODO +* Implement warning speed for temporary slow zones ("vorübergehende Langsamfahrstellen") with Lf 1/Lf 2 and Lf 3. +* Use Zs 3 instead of Lf 7 for the main speed restriction; use Lf 7 for line speed restriction. +* Change the "E" sign to Zs 10. diff --git a/advtrains_signals_ks/init.lua b/advtrains_signals_ks/init.lua index 3a2f4d0..14d27b8 100755 --- a/advtrains_signals_ks/init.lua +++ b/advtrains_signals_ks/init.lua @@ -116,6 +116,7 @@ local suppasp_ra = { advtrains.trackplacer.register_tracktype("advtrains_signals_ks:hs") advtrains.trackplacer.register_tracktype("advtrains_signals_ks:ra") advtrains.trackplacer.register_tracktype("advtrains_signals_ks:sign") +advtrains.trackplacer.register_tracktype("advtrains_signals_ks:sign_lf") advtrains.trackplacer.register_tracktype("advtrains_signals_ks:zs3") advtrains.trackplacer.register_tracktype("advtrains_signals_ks:zs3v") advtrains.trackplacer.register_tracktype("advtrains_signals_ks:mast") @@ -296,6 +297,47 @@ for _, rtab in ipairs({ -- rotatable by trackworker advtrains.trackplacer.add_worked("advtrains_signals_ks:sign", typ, "_"..rot, prts.n) end + + for typ, prts in pairs { + [8] = {main = 8, n = "12", ici = true}, + [12] = {main = 12, n = "16"}, + [16] = {main = 16, n = "e"}, + ["e"] = {main = -1, n = "8"} + } do + minetest.register_node("advtrains_signals_ks:sign_lf_"..typ.."_"..rot, { + description = "Temporary local speed restriction sign", + drawtype = "mesh", + mesh = "advtrains_signals_ks_sign_smr"..rot..".obj", + tiles = {"advtrains_signals_ks_signpost.png", "advtrains_signals_ks_sign_"..typ..".png^[multiply:orange"}, + paramtype = "light", + sunlight_propagates = true, + light_source = 4, + paramtype2 = "facedir", + selection_box = { + type = "fixed", + fixed = {rtab.sbox, {-1/4, -1/2, -1/4, 1/4, -7/16, 1/4}} + }, + groups = { + cracky = 2, + advtrains_signal = 2, + not_blocking_trains = 1, + save_in_at_nodedb = 1, + not_in_creative_inventory = (rtab.ici and prts.ici) and 0 or 1, + }, + drop = "advtrains_signals_ks:sign_lf_8_0", + inventory_image = "advtrains_signals_ks_sign_8.png^[multiply:orange", + advtrains = { + -- This is a static signal! No set_aspect + get_aspect = function(pos, node) + return {main = prts.main, type = "temp"} + end, + }, + on_rightclick = advtrains.interlocking.signal_rc_handler, + can_dig = advtrains.interlocking.signal_can_dig, + after_dig_node = advtrains.interlocking.signal_after_dig + }) + advtrains.trackplacer.add_worked("advtrains_signals_ks:sign_lf", tostring(typ), "_"..rot, prts.n) + end -- Geschwindigkeits(vor)anzeiger für Ks-Signale for typ, prts in pairs({ -- cgit v1.2.3