summaryrefslogtreecommitdiff
path: root/durt
diff options
context:
space:
mode:
Diffstat (limited to 'durt')
-rw-r--r--durt/nodes/(-1973,16,800).lua28
-rw-r--r--durt/nodes/(-2039,19,719).lua9
-rw-r--r--durt/nodes/(-2204,8,-651).lua26
-rw-r--r--durt/nodes/(-2204,8,-676).lua30
-rw-r--r--durt/nodes/(-2209,9,-651).lua10
-rw-r--r--durt/nodes/(-2213,10,-728).lua2
-rw-r--r--durt/nodes/(-4138,13,-5778).lua7
7 files changed, 99 insertions, 13 deletions
diff --git a/durt/nodes/(-1973,16,800).lua b/durt/nodes/(-1973,16,800).lua
index e886d2b..0e7e05c 100644
--- a/durt/nodes/(-1973,16,800).lua
+++ b/durt/nodes/(-1973,16,800).lua
@@ -6,8 +6,9 @@ local sections ={
store_4 = "032832" -- Destined for Arcadius Basement Loading Dock
}
local function send_train()
- atc_send("S0WRD2A1S4")
- local cmd = { -- collect wagons from BYARD, and park loco in loco siding if no departures at ARC
+ -- define default command to be overwritten if departures/local job available
+ -- collect wagons from BYARD, and park loco in loco siding if no departures at ARC
+ local cmd = {
"FREIGHT",
"ARC_LOCOSTORE",
"ARC_AUTO",
@@ -22,27 +23,28 @@ local function send_train()
"ARC_LIGHT_EXIT"
}
if #section_occupancy(sections.store_4) > 0 then
- if print_notification then print(rwt.to_string(rwt.now()).. " "..notification_id.." send_train() has local job from STORE_4") end
-- perform local job to Arcadius Basement Loading Dock before taking wagons to BYARD
+ if print_notification then print(rwt.to_string(rwt.now()).. " "..notification_id.." send_train() has local job from STORE_4") end
cmd = {
- "FREIGHT", --because it's freight
- "ARC_LOCOSTORE", --technically the loco identifier until we have wagon ID. will be ignored by yard_headshunt because no "ARC_DEPART" etc
- "ARC_YARD_REENTRY", --redirect back into the yard from yard_exit controller. will be checked by yard_exit before ARS triggers
- "ARC_RTS", --basic yard call
- "ARC_COLLECT_ARC_LOAD_DOCK", -- collect req wagons. can be left in place, if train_length == 1 then will return to siding anyway
- "ARC_AUTO_LOCAL_LOADING", --direct to ARC Basement Loading Dock
- "ARC_LOAD", --trigger the loading track
+ "FREIGHT", --because it's freight
+ "ARC_LOCOSTORE", --technically the loco identifier until we have wagon ID. will be ignored by yard_headshunt because no "ARC_DEPART" etc
+ "ARC_YARD_REENTRY", --redirect back into the yard from yard_exit controller. will be checked by yard_exit before ARS triggers
+ "ARC_RTS", --basic yard call
+ "ARC_COLLECT_ARC_LOAD_DOCK", -- collect req wagons. can be left in place, if train_length == 1 then will return to siding anyway
+ "ARC_AUTO_LOCAL_LOADING", --direct to ARC Basement Loading Dock
+ "ARC_LOAD", --trigger the loading track
}
elseif #section_occupancy(sections.departures) > 0 then
+ -- reenter yard, collect departures and head to Byard
if print_notification then print(rwt.to_string(rwt.now()).. " "..notification_id.." send_train() has local job from DEPARTURES") end
- cmd = { -- collect wagons from BYARD, and park loco in loco siding if no departures at ARC
+ cmd = {
"FREIGHT",
"ARC_LOCOSTORE",
"ARC_AUTO",
+ "ARC_YARD_REENTRY", -- trigger yard reentry on light exit
+ "ARC_2ND_EXIT_ARC_AUTO_S23S", -- exit direction after
"ARC_RTS",
"ARC_COLLECT_ARC_SB",
- "ARC_YARD_REENTRY",
- "ARC_2ND_EXIT_ARC_AUTO_S23S",
"S23E3N",
"BYARD",
"BY_RTS",
diff --git a/durt/nodes/(-2039,19,719).lua b/durt/nodes/(-2039,19,719).lua
index 107d03f..5a090ad 100644
--- a/durt/nodes/(-2039,19,719).lua
+++ b/durt/nodes/(-2039,19,719).lua
@@ -28,6 +28,15 @@ if event.train then
end
if rm_rc then F.remove_rc({rev_rc}) end
schedule_in(";01",atc_id)
+
+ -- remove stray control flags
+ F.remove_rc_match("ARC_LOCOS_%S+")
+ F.remove_rc_match("ARC_WAGONS_%S+")
+ F.remove_rc({
+ "ARC_DEPART",
+ "ARC_FINAL_COLLECT"
+ })
+
return
end
diff --git a/durt/nodes/(-2204,8,-651).lua b/durt/nodes/(-2204,8,-651).lua
new file mode 100644
index 0000000..d8539fb
--- /dev/null
+++ b/durt/nodes/(-2204,8,-651).lua
@@ -0,0 +1,26 @@
+local cmd = {
+ "TREES_RUNAROUND",
+ "SHUNT_MAINLINE_REV",
+}
+__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 and atc_arrow then
+ if not F.has_rc("BYARD_NOID_SHUTTLE") then return end -- not our train, disregard
+ if not F.has_rc("TREES_RUNAROUND") then -- train has arrived from yard, split and runaround
+ split_off_locomotive("A0B0") --disable ARS to stop the rest of the train engaging the signal
+ F.add_rc(cmd) --add RC commands tomake the train runaround
+ atc_send("S3A1") --send the loco on its way to make the runaround
+ return
+ end
+ --else loco has returned from runaround
+ F.remove_rc(cmd) -- remove runaround RCs
+ atc_send("S0WRS1") --reverse the train and creep towards the other departure signal
+ return
+end
+ \ No newline at end of file
diff --git a/durt/nodes/(-2204,8,-676).lua b/durt/nodes/(-2204,8,-676).lua
new file mode 100644
index 0000000..834ba6c
--- /dev/null
+++ b/durt/nodes/(-2204,8,-676).lua
@@ -0,0 +1,30 @@
+local notification_id = "NOID"
+local ind = POS(-2209,8,-651) -- IMPORTANT NB: remember to update this if you move the indicator mesecon switch
+local print_notification = true
+local function send_train()
+ set_rc("FREIGHT BYARD_NOID_SHUTTLE BYARD BY_COLLECT_NOID BY_RTS NIDTH NOIDEA IND TREES") -- RC string to overwrite when departing for the autoyard, remember to include the return RCs as well
+ step_fc() --step the fc forward to be ready for the autoyard
+ atc_send("A1SM")
+ F.indicator(ind,false)
+end
+if event.ext_int then -- trigger event from the yard itself.
+ if event.message == "notify" then -- can also be a manual/other message, just edit this if statement
+ if print_notification then print(rwt.to_string(rwt.now()).. " "..notification_id.." RX Notification") end
+ if F.indicator(ind) then return end -- indicator is already lit, train hasn't collected the first set yet
+ if atc_id then --send the train to the yard for collection
+ send_train()
+ return
+ else -- set the indicator to await the returning train
+ F.indicator(ind,true)
+ return
+ end
+ end
+end
+if event.train and atc_arrow then
+ if F.indicator(ind) then
+ send_train()
+ return
+ end
+ atc_send("B0")
+ return
+end \ No newline at end of file
diff --git a/durt/nodes/(-2209,9,-651).lua b/durt/nodes/(-2209,9,-651).lua
new file mode 100644
index 0000000..fdf1611
--- /dev/null
+++ b/durt/nodes/(-2209,9,-651).lua
@@ -0,0 +1,10 @@
+local users = {
+"gabriel",
+"survivalg",
+"Maverick2797"
+}
+if event.punch then
+ for _,name in pairs(users) do
+ if event.name==name then interrupt_pos(POS(-2204,8,-676),"notify") return end
+ end
+end \ No newline at end of file
diff --git a/durt/nodes/(-2213,10,-728).lua b/durt/nodes/(-2213,10,-728).lua
new file mode 100644
index 0000000..23ac35d
--- /dev/null
+++ b/durt/nodes/(-2213,10,-728).lua
@@ -0,0 +1,2 @@
+if not F.has_rc("TREES_RUNAROUND") then return end
+atc_send("CplS1") \ No newline at end of file
diff --git a/durt/nodes/(-4138,13,-5778).lua b/durt/nodes/(-4138,13,-5778).lua
new file mode 100644
index 0000000..7d57cd6
--- /dev/null
+++ b/durt/nodes/(-4138,13,-5778).lua
@@ -0,0 +1,7 @@
+print(rwt.to_string(rwt.now()))
+local fc_array = get_fc()
+for idx,list in ipairs(fc_array) do
+ fc_array[idx] = list:split("!",true)
+end
+print(fc_array)
+print(get_fc_index()) \ No newline at end of file