summaryrefslogtreecommitdiff
path: root/Tyard/nodes
diff options
context:
space:
mode:
Diffstat (limited to 'Tyard/nodes')
-rw-r--r--Tyard/nodes/(-3967,12,-2646).lua37
-rw-r--r--Tyard/nodes/(-4012,12,-2646).lua3
-rw-r--r--Tyard/nodes/(-4027,12,-2655).lua1
-rw-r--r--Tyard/nodes/(-4027,12,-2731).lua1
-rw-r--r--Tyard/nodes/(-4031,12,-2655).lua5
-rw-r--r--Tyard/nodes/(-4031,12,-2731).lua5
-rw-r--r--Tyard/nodes/(-4035,12,-2655).lua5
-rw-r--r--Tyard/nodes/(-4035,12,-2731).lua5
-rw-r--r--Tyard/nodes/(-4039,12,-2655).lua5
-rw-r--r--Tyard/nodes/(-4039,12,-2731).lua5
-rw-r--r--Tyard/nodes/(-4043,12,-2655).lua5
-rw-r--r--Tyard/nodes/(-4043,12,-2731).lua5
-rw-r--r--Tyard/nodes/(-4047,12,-2655).lua5
-rw-r--r--Tyard/nodes/(-4047,12,-2731).lua5
-rw-r--r--Tyard/nodes/(-4051,12,-2655).lua5
-rw-r--r--Tyard/nodes/(-4051,12,-2731).lua5
-rw-r--r--Tyard/nodes/(-4055,12,-2655).lua5
-rw-r--r--Tyard/nodes/(-4055,12,-2731).lua5
-rw-r--r--Tyard/nodes/(-4100,12,-2742).lua3
-rw-r--r--Tyard/nodes/(-4167,12,-2742).lua38
20 files changed, 121 insertions, 32 deletions
diff --git a/Tyard/nodes/(-3967,12,-2646).lua b/Tyard/nodes/(-3967,12,-2646).lua
index 341efa9..828ca13 100644
--- a/Tyard/nodes/(-3967,12,-2646).lua
+++ b/Tyard/nodes/(-3967,12,-2646).lua
@@ -1 +1,36 @@
--- Headshunt Exit Controller \ No newline at end of file
+-- Headshunt Exit Controller
+local exit_signal = POS(-3962,14,-2645)
+__approach_callback_mode = 1
+if event.approach and not event.has_entered then
+ atc_set_ars_disable(true)
+ atc_set_lzb_tsr(1)
+ return
+end
+
+if event.train then
+ if atc_arrow then
+ if F.has_rc("TY_DEPART") then
+ print("Train departs yard to mainline at full speed")
+
+ F.remove_rc({"TY_DEPART"})
+ atc_set_ars_disable(false)
+ -- set_route(exit_signal,"Exit Yard")
+ atc_send("S6D10SM")
+ -- schedule_in(";05","deactivate_check")
+ return
+ else
+ atc_send("BBOL")
+ F.error(true)
+ end
+end
+
+if event.schedule then
+ if event.msg == "deactivate_check" then
+ if not atc_id then
+ F.yard_active(false)
+ else
+ schedule_in(";05","deactivate_check")
+ return
+ end
+ end
+end \ No newline at end of file
diff --git a/Tyard/nodes/(-4012,12,-2646).lua b/Tyard/nodes/(-4012,12,-2646).lua
index 751506b..b312753 100644
--- a/Tyard/nodes/(-4012,12,-2646).lua
+++ b/Tyard/nodes/(-4012,12,-2646).lua
@@ -1,7 +1,7 @@
-- Headshunt Controller
-- Note: may need customising due to track layout
local this_dir = true -- true = F.dir arrow points north. atc_arrow points towards yard
-local error_indicator = POS(-4025,13,-2671)
+
__approach_callback_mode = 1
if event.approach and not event.has_entered then
atc_set_ars_disable(true)
@@ -11,6 +11,7 @@ end
if event.train then
if not atc_arrow then --train has entered headshunt from yard. bounce or depart
+ F.remove_rc({"TY_HEADSHUNT"})
if not F.has_rc("TY_DEPART") then --if has TY_DEPART then another controller closer to the signal will remove to ensure signal engages the RC
schedule_in(";01",atc_id)
atc_set_ars_disable(true)
diff --git a/Tyard/nodes/(-4027,12,-2655).lua b/Tyard/nodes/(-4027,12,-2655).lua
index c090df1..d6aac1f 100644
--- a/Tyard/nodes/(-4027,12,-2655).lua
+++ b/Tyard/nodes/(-4027,12,-2655).lua
@@ -28,6 +28,7 @@ if F.yard_active() then
F.add_rc({"TY_FINAL_COLLECT","TY_CLASS_"..collect}) --loco is to collect lane before departing. TY_DEPART to be set by EOL
end
end
+ F.add_rc({"TY_HEADSHUNT"})
atc_set_ars_disable(false)
else --bounce train back towards working end
atc_send("S0WRD1S3A1")
diff --git a/Tyard/nodes/(-4027,12,-2731).lua b/Tyard/nodes/(-4027,12,-2731).lua
index 30321c2..9968850 100644
--- a/Tyard/nodes/(-4027,12,-2731).lua
+++ b/Tyard/nodes/(-4027,12,-2731).lua
@@ -28,6 +28,7 @@ if F.yard_active() then
F.add_rc({"TY_FINAL_COLLECT","TY_CLASS_"..collect}) --loco is to collect lane before departing. TY_DEPART to be set by EOL
end
end
+ F.add_rc({"TY_HEADSHUNT"})
atc_set_ars_disable(false)
else --bounce train back towards working end
atc_send("S0WRD1S3A1")
diff --git a/Tyard/nodes/(-4031,12,-2655).lua b/Tyard/nodes/(-4031,12,-2655).lua
index 512ce80..91291bf 100644
--- a/Tyard/nodes/(-4031,12,-2655).lua
+++ b/Tyard/nodes/(-4031,12,-2655).lua
@@ -1,6 +1,6 @@
--EOL code
local this_dir = true -- true = F.dir arrow points north
-local error_indicator = POS(-4025,13,-2671)
+
if F.yard_active() then
if atc_arrow then
if F.dir() == this_dir then --train has bounced and needs to leave the rake or depart with it
@@ -11,6 +11,7 @@ if F.yard_active() then
split_off_locomotive("A0B0")
F.add_rc({"TY_PICKUP"})
end
+ F.add_rc({"TY_HEADSHUNT"})
else --train needs to bounce
atc_send("B0WRD1S4")
end
@@ -24,7 +25,7 @@ if F.yard_active() then
F.remove_rc(rm)
else --this should never come into play as it means the train has entered from the wrong end somehow
atc_send("BBOL") --stop the train and open the doors (if available) to signify assistance required
- setstate(error_indicator,"on")
+ F.error(true)
end
end
end \ No newline at end of file
diff --git a/Tyard/nodes/(-4031,12,-2731).lua b/Tyard/nodes/(-4031,12,-2731).lua
index 12b9ecf..5c809b6 100644
--- a/Tyard/nodes/(-4031,12,-2731).lua
+++ b/Tyard/nodes/(-4031,12,-2731).lua
@@ -1,6 +1,6 @@
--EOL code
local this_dir = false -- true = F.dir arrow points north
-local error_indicator = POS(-4025,13,-2671)
+
if F.yard_active() then
if atc_arrow then
if F.dir() == this_dir then --train has bounced and needs to leave the rake or depart with it
@@ -11,6 +11,7 @@ if F.yard_active() then
split_off_locomotive("A0B0")
F.add_rc({"TY_PICKUP"})
end
+ F.add_rc({"TY_HEADSHUNT"})
else --train needs to bounce
atc_send("B0WRD1S4")
end
@@ -24,7 +25,7 @@ if F.yard_active() then
F.remove_rc(rm)
else --this should never come into play as it means the train has entered from the wrong end somehow
atc_send("BBOL") --stop the train and open the doors (if available) to signify assistance required
- setstate(error_indicator,"on")
+ F.error(true)
end
end
end \ No newline at end of file
diff --git a/Tyard/nodes/(-4035,12,-2655).lua b/Tyard/nodes/(-4035,12,-2655).lua
index 512ce80..91291bf 100644
--- a/Tyard/nodes/(-4035,12,-2655).lua
+++ b/Tyard/nodes/(-4035,12,-2655).lua
@@ -1,6 +1,6 @@
--EOL code
local this_dir = true -- true = F.dir arrow points north
-local error_indicator = POS(-4025,13,-2671)
+
if F.yard_active() then
if atc_arrow then
if F.dir() == this_dir then --train has bounced and needs to leave the rake or depart with it
@@ -11,6 +11,7 @@ if F.yard_active() then
split_off_locomotive("A0B0")
F.add_rc({"TY_PICKUP"})
end
+ F.add_rc({"TY_HEADSHUNT"})
else --train needs to bounce
atc_send("B0WRD1S4")
end
@@ -24,7 +25,7 @@ if F.yard_active() then
F.remove_rc(rm)
else --this should never come into play as it means the train has entered from the wrong end somehow
atc_send("BBOL") --stop the train and open the doors (if available) to signify assistance required
- setstate(error_indicator,"on")
+ F.error(true)
end
end
end \ No newline at end of file
diff --git a/Tyard/nodes/(-4035,12,-2731).lua b/Tyard/nodes/(-4035,12,-2731).lua
index 12b9ecf..5c809b6 100644
--- a/Tyard/nodes/(-4035,12,-2731).lua
+++ b/Tyard/nodes/(-4035,12,-2731).lua
@@ -1,6 +1,6 @@
--EOL code
local this_dir = false -- true = F.dir arrow points north
-local error_indicator = POS(-4025,13,-2671)
+
if F.yard_active() then
if atc_arrow then
if F.dir() == this_dir then --train has bounced and needs to leave the rake or depart with it
@@ -11,6 +11,7 @@ if F.yard_active() then
split_off_locomotive("A0B0")
F.add_rc({"TY_PICKUP"})
end
+ F.add_rc({"TY_HEADSHUNT"})
else --train needs to bounce
atc_send("B0WRD1S4")
end
@@ -24,7 +25,7 @@ if F.yard_active() then
F.remove_rc(rm)
else --this should never come into play as it means the train has entered from the wrong end somehow
atc_send("BBOL") --stop the train and open the doors (if available) to signify assistance required
- setstate(error_indicator,"on")
+ F.error(true)
end
end
end \ No newline at end of file
diff --git a/Tyard/nodes/(-4039,12,-2655).lua b/Tyard/nodes/(-4039,12,-2655).lua
index 512ce80..91291bf 100644
--- a/Tyard/nodes/(-4039,12,-2655).lua
+++ b/Tyard/nodes/(-4039,12,-2655).lua
@@ -1,6 +1,6 @@
--EOL code
local this_dir = true -- true = F.dir arrow points north
-local error_indicator = POS(-4025,13,-2671)
+
if F.yard_active() then
if atc_arrow then
if F.dir() == this_dir then --train has bounced and needs to leave the rake or depart with it
@@ -11,6 +11,7 @@ if F.yard_active() then
split_off_locomotive("A0B0")
F.add_rc({"TY_PICKUP"})
end
+ F.add_rc({"TY_HEADSHUNT"})
else --train needs to bounce
atc_send("B0WRD1S4")
end
@@ -24,7 +25,7 @@ if F.yard_active() then
F.remove_rc(rm)
else --this should never come into play as it means the train has entered from the wrong end somehow
atc_send("BBOL") --stop the train and open the doors (if available) to signify assistance required
- setstate(error_indicator,"on")
+ F.error(true)
end
end
end \ No newline at end of file
diff --git a/Tyard/nodes/(-4039,12,-2731).lua b/Tyard/nodes/(-4039,12,-2731).lua
index 12b9ecf..5c809b6 100644
--- a/Tyard/nodes/(-4039,12,-2731).lua
+++ b/Tyard/nodes/(-4039,12,-2731).lua
@@ -1,6 +1,6 @@
--EOL code
local this_dir = false -- true = F.dir arrow points north
-local error_indicator = POS(-4025,13,-2671)
+
if F.yard_active() then
if atc_arrow then
if F.dir() == this_dir then --train has bounced and needs to leave the rake or depart with it
@@ -11,6 +11,7 @@ if F.yard_active() then
split_off_locomotive("A0B0")
F.add_rc({"TY_PICKUP"})
end
+ F.add_rc({"TY_HEADSHUNT"})
else --train needs to bounce
atc_send("B0WRD1S4")
end
@@ -24,7 +25,7 @@ if F.yard_active() then
F.remove_rc(rm)
else --this should never come into play as it means the train has entered from the wrong end somehow
atc_send("BBOL") --stop the train and open the doors (if available) to signify assistance required
- setstate(error_indicator,"on")
+ F.error(true)
end
end
end \ No newline at end of file
diff --git a/Tyard/nodes/(-4043,12,-2655).lua b/Tyard/nodes/(-4043,12,-2655).lua
index 512ce80..91291bf 100644
--- a/Tyard/nodes/(-4043,12,-2655).lua
+++ b/Tyard/nodes/(-4043,12,-2655).lua
@@ -1,6 +1,6 @@
--EOL code
local this_dir = true -- true = F.dir arrow points north
-local error_indicator = POS(-4025,13,-2671)
+
if F.yard_active() then
if atc_arrow then
if F.dir() == this_dir then --train has bounced and needs to leave the rake or depart with it
@@ -11,6 +11,7 @@ if F.yard_active() then
split_off_locomotive("A0B0")
F.add_rc({"TY_PICKUP"})
end
+ F.add_rc({"TY_HEADSHUNT"})
else --train needs to bounce
atc_send("B0WRD1S4")
end
@@ -24,7 +25,7 @@ if F.yard_active() then
F.remove_rc(rm)
else --this should never come into play as it means the train has entered from the wrong end somehow
atc_send("BBOL") --stop the train and open the doors (if available) to signify assistance required
- setstate(error_indicator,"on")
+ F.error(true)
end
end
end \ No newline at end of file
diff --git a/Tyard/nodes/(-4043,12,-2731).lua b/Tyard/nodes/(-4043,12,-2731).lua
index 12b9ecf..5c809b6 100644
--- a/Tyard/nodes/(-4043,12,-2731).lua
+++ b/Tyard/nodes/(-4043,12,-2731).lua
@@ -1,6 +1,6 @@
--EOL code
local this_dir = false -- true = F.dir arrow points north
-local error_indicator = POS(-4025,13,-2671)
+
if F.yard_active() then
if atc_arrow then
if F.dir() == this_dir then --train has bounced and needs to leave the rake or depart with it
@@ -11,6 +11,7 @@ if F.yard_active() then
split_off_locomotive("A0B0")
F.add_rc({"TY_PICKUP"})
end
+ F.add_rc({"TY_HEADSHUNT"})
else --train needs to bounce
atc_send("B0WRD1S4")
end
@@ -24,7 +25,7 @@ if F.yard_active() then
F.remove_rc(rm)
else --this should never come into play as it means the train has entered from the wrong end somehow
atc_send("BBOL") --stop the train and open the doors (if available) to signify assistance required
- setstate(error_indicator,"on")
+ F.error(true)
end
end
end \ No newline at end of file
diff --git a/Tyard/nodes/(-4047,12,-2655).lua b/Tyard/nodes/(-4047,12,-2655).lua
index 512ce80..91291bf 100644
--- a/Tyard/nodes/(-4047,12,-2655).lua
+++ b/Tyard/nodes/(-4047,12,-2655).lua
@@ -1,6 +1,6 @@
--EOL code
local this_dir = true -- true = F.dir arrow points north
-local error_indicator = POS(-4025,13,-2671)
+
if F.yard_active() then
if atc_arrow then
if F.dir() == this_dir then --train has bounced and needs to leave the rake or depart with it
@@ -11,6 +11,7 @@ if F.yard_active() then
split_off_locomotive("A0B0")
F.add_rc({"TY_PICKUP"})
end
+ F.add_rc({"TY_HEADSHUNT"})
else --train needs to bounce
atc_send("B0WRD1S4")
end
@@ -24,7 +25,7 @@ if F.yard_active() then
F.remove_rc(rm)
else --this should never come into play as it means the train has entered from the wrong end somehow
atc_send("BBOL") --stop the train and open the doors (if available) to signify assistance required
- setstate(error_indicator,"on")
+ F.error(true)
end
end
end \ No newline at end of file
diff --git a/Tyard/nodes/(-4047,12,-2731).lua b/Tyard/nodes/(-4047,12,-2731).lua
index 12b9ecf..5c809b6 100644
--- a/Tyard/nodes/(-4047,12,-2731).lua
+++ b/Tyard/nodes/(-4047,12,-2731).lua
@@ -1,6 +1,6 @@
--EOL code
local this_dir = false -- true = F.dir arrow points north
-local error_indicator = POS(-4025,13,-2671)
+
if F.yard_active() then
if atc_arrow then
if F.dir() == this_dir then --train has bounced and needs to leave the rake or depart with it
@@ -11,6 +11,7 @@ if F.yard_active() then
split_off_locomotive("A0B0")
F.add_rc({"TY_PICKUP"})
end
+ F.add_rc({"TY_HEADSHUNT"})
else --train needs to bounce
atc_send("B0WRD1S4")
end
@@ -24,7 +25,7 @@ if F.yard_active() then
F.remove_rc(rm)
else --this should never come into play as it means the train has entered from the wrong end somehow
atc_send("BBOL") --stop the train and open the doors (if available) to signify assistance required
- setstate(error_indicator,"on")
+ F.error(true)
end
end
end \ No newline at end of file
diff --git a/Tyard/nodes/(-4051,12,-2655).lua b/Tyard/nodes/(-4051,12,-2655).lua
index 512ce80..91291bf 100644
--- a/Tyard/nodes/(-4051,12,-2655).lua
+++ b/Tyard/nodes/(-4051,12,-2655).lua
@@ -1,6 +1,6 @@
--EOL code
local this_dir = true -- true = F.dir arrow points north
-local error_indicator = POS(-4025,13,-2671)
+
if F.yard_active() then
if atc_arrow then
if F.dir() == this_dir then --train has bounced and needs to leave the rake or depart with it
@@ -11,6 +11,7 @@ if F.yard_active() then
split_off_locomotive("A0B0")
F.add_rc({"TY_PICKUP"})
end
+ F.add_rc({"TY_HEADSHUNT"})
else --train needs to bounce
atc_send("B0WRD1S4")
end
@@ -24,7 +25,7 @@ if F.yard_active() then
F.remove_rc(rm)
else --this should never come into play as it means the train has entered from the wrong end somehow
atc_send("BBOL") --stop the train and open the doors (if available) to signify assistance required
- setstate(error_indicator,"on")
+ F.error(true)
end
end
end \ No newline at end of file
diff --git a/Tyard/nodes/(-4051,12,-2731).lua b/Tyard/nodes/(-4051,12,-2731).lua
index 12b9ecf..5c809b6 100644
--- a/Tyard/nodes/(-4051,12,-2731).lua
+++ b/Tyard/nodes/(-4051,12,-2731).lua
@@ -1,6 +1,6 @@
--EOL code
local this_dir = false -- true = F.dir arrow points north
-local error_indicator = POS(-4025,13,-2671)
+
if F.yard_active() then
if atc_arrow then
if F.dir() == this_dir then --train has bounced and needs to leave the rake or depart with it
@@ -11,6 +11,7 @@ if F.yard_active() then
split_off_locomotive("A0B0")
F.add_rc({"TY_PICKUP"})
end
+ F.add_rc({"TY_HEADSHUNT"})
else --train needs to bounce
atc_send("B0WRD1S4")
end
@@ -24,7 +25,7 @@ if F.yard_active() then
F.remove_rc(rm)
else --this should never come into play as it means the train has entered from the wrong end somehow
atc_send("BBOL") --stop the train and open the doors (if available) to signify assistance required
- setstate(error_indicator,"on")
+ F.error(true)
end
end
end \ No newline at end of file
diff --git a/Tyard/nodes/(-4055,12,-2655).lua b/Tyard/nodes/(-4055,12,-2655).lua
index 512ce80..91291bf 100644
--- a/Tyard/nodes/(-4055,12,-2655).lua
+++ b/Tyard/nodes/(-4055,12,-2655).lua
@@ -1,6 +1,6 @@
--EOL code
local this_dir = true -- true = F.dir arrow points north
-local error_indicator = POS(-4025,13,-2671)
+
if F.yard_active() then
if atc_arrow then
if F.dir() == this_dir then --train has bounced and needs to leave the rake or depart with it
@@ -11,6 +11,7 @@ if F.yard_active() then
split_off_locomotive("A0B0")
F.add_rc({"TY_PICKUP"})
end
+ F.add_rc({"TY_HEADSHUNT"})
else --train needs to bounce
atc_send("B0WRD1S4")
end
@@ -24,7 +25,7 @@ if F.yard_active() then
F.remove_rc(rm)
else --this should never come into play as it means the train has entered from the wrong end somehow
atc_send("BBOL") --stop the train and open the doors (if available) to signify assistance required
- setstate(error_indicator,"on")
+ F.error(true)
end
end
end \ No newline at end of file
diff --git a/Tyard/nodes/(-4055,12,-2731).lua b/Tyard/nodes/(-4055,12,-2731).lua
index 12b9ecf..5c809b6 100644
--- a/Tyard/nodes/(-4055,12,-2731).lua
+++ b/Tyard/nodes/(-4055,12,-2731).lua
@@ -1,6 +1,6 @@
--EOL code
local this_dir = false -- true = F.dir arrow points north
-local error_indicator = POS(-4025,13,-2671)
+
if F.yard_active() then
if atc_arrow then
if F.dir() == this_dir then --train has bounced and needs to leave the rake or depart with it
@@ -11,6 +11,7 @@ if F.yard_active() then
split_off_locomotive("A0B0")
F.add_rc({"TY_PICKUP"})
end
+ F.add_rc({"TY_HEADSHUNT"})
else --train needs to bounce
atc_send("B0WRD1S4")
end
@@ -24,7 +25,7 @@ if F.yard_active() then
F.remove_rc(rm)
else --this should never come into play as it means the train has entered from the wrong end somehow
atc_send("BBOL") --stop the train and open the doors (if available) to signify assistance required
- setstate(error_indicator,"on")
+ F.error(true)
end
end
end \ No newline at end of file
diff --git a/Tyard/nodes/(-4100,12,-2742).lua b/Tyard/nodes/(-4100,12,-2742).lua
index 1917d7f..ecc670f 100644
--- a/Tyard/nodes/(-4100,12,-2742).lua
+++ b/Tyard/nodes/(-4100,12,-2742).lua
@@ -1,7 +1,7 @@
-- Headshunt Controller
-- Note: may need customising due to track layout
local this_dir = false -- true = F.dir arrow points north. atc_arrow points towards yard
-local error_indicator = POS(-4025,13,-2671)
+
__approach_callback_mode = 1
if event.approach and not event.has_entered then
atc_set_ars_disable(true)
@@ -11,6 +11,7 @@ end
if event.train then
if not atc_arrow then --train has entered headshunt from yard. bounce or depart
+ F.remove_rc({"TY_HEADSHUNT"})
if not F.has_rc("TY_DEPART") then --if has TY_DEPART then another controller closer to the signal will remove to ensure signal engages the RC
schedule_in(";01",atc_id)
atc_set_ars_disable(true)
diff --git a/Tyard/nodes/(-4167,12,-2742).lua b/Tyard/nodes/(-4167,12,-2742).lua
index 341efa9..a1ad270 100644
--- a/Tyard/nodes/(-4167,12,-2742).lua
+++ b/Tyard/nodes/(-4167,12,-2742).lua
@@ -1 +1,37 @@
--- Headshunt Exit Controller \ No newline at end of file
+-- Headshunt Exit Controller
+local exit_signal = POS(-4178,15,-2742)
+__approach_callback_mode = 1
+if event.approach and not event.has_entered then
+ atc_set_ars_disable(true)
+ atc_set_lzb_tsr(1)
+ return
+end
+
+if event.train then
+ if atc_arrow then
+ if F.has_rc("TY_DEPART") then
+ print("Train departs yard to mainline at full speed")
+ --[[
+ F.remove_rc({"TY_DEPART"})
+ atc_set_ars_disable(false)
+ set_route(exit_signal,"Exit Yard")
+ atc_send("S6D10SM")
+ schedule_in(";05","deactivate_check")
+ return
+ ]]--
+ else
+ atc_send("BBOL")
+ F.error(true)
+ end
+end
+
+if event.schedule then
+ if event.msg == "deactivate_check" then
+ if not atc_id then
+ F.yard_active(false)
+ else
+ schedule_in(";05","deactivate_check")
+ return
+ end
+ end
+end \ No newline at end of file