summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorautocommitter <autocommitter@linux-forks.de>2025-02-23 00:00:02 +0100
committerautocommitter <autocommitter@linux-forks.de>2025-02-23 00:00:02 +0100
commita46d1734178018758c2e2320b8d743aad4b359e3 (patch)
tree5177b03ea60bcdd70693ca7e1537337b1a31cfa6
parentdd45c9367473b320c15d45d4d363b62c241c838b (diff)
downloadluaatc_envs-a46d1734178018758c2e2320b8d743aad4b359e3.tar.gz
luaatc_envs-a46d1734178018758c2e2320b8d743aad4b359e3.tar.bz2
luaatc_envs-a46d1734178018758c2e2320b8d743aad4b359e3.zip
State at 2025-02-23HEADmaster
-rw-r--r--auto_yards/nodes/(-2029,19,733).lua36
-rw-r--r--auto_yards/nodes/(-2042,19,723).lua8
-rw-r--r--durt/nodes/(-1973,16,800).lua28
-rw-r--r--durt/nodes/(-2039,19,719).lua9
-rw-r--r--durt/nodes/(-4138,13,-5778).lua7
5 files changed, 61 insertions, 27 deletions
diff --git a/auto_yards/nodes/(-2029,19,733).lua b/auto_yards/nodes/(-2029,19,733).lua
index 58ed28c..afbb94b 100644
--- a/auto_yards/nodes/(-2029,19,733).lua
+++ b/auto_yards/nodes/(-2029,19,733).lua
@@ -1,28 +1,36 @@
local yard_id = "ARC"
+
+__approach_callback_mode = 1
+if event.approach and not event.has_entered then --disable ARS for all approaching trains
+ atc_set_ars_disable(true)
+ atc_set_lzb_tsr(1)
+ return
+end
+
if event.train then
- -- direct train to the headshunt to reenter the yard
if F.has_rc("ARC_YARD_REENTRY") then
-- loco will use S23-S approach track as headshunt and re-enter yard
-- RC will be removed by the headshunt controller (req to trigger it)
-- manually set the route here before ARS has a chance
set_route(POS(-2033,21,731),"Yard Reentry (LENGTH LIMIT)")
- -- defer re-enabling ARS to ensure the route has been accepted, if not set
+ F.indicator(S.yards[yard_id].active_indicator_pos,false)
+
+ -- Extract the second exit director from ARC_2nd_EXIT_x and insert if available
+ -- should be safe to add it now as the route has already been set to reenter the yard first
+ local rc = F.get_rc_safe():match("ARC_2ND_EXIT_(%S+)")
+ print("Second Exit RC: "..tostring(rc))
+ if rc then
+ F.remove_rc_match("ARC_2ND_EXIT_%S+")
+ F.add_rc(rc)
+ print(F.get_rc_safe())
+ end
+
+ -- defer re-enabling ARS to ensure the route has been accepted, or at least queued
atc_send("S4D1A1")
- return
+ return
end
- -- deal with ARC_2nd_EXIT_rc
- local rc = F.get_rc_safe():match("ARC_2ND_EXIT_(%S+)")
- print(rc)
- if rc then
- F.remove_rc_match("ARC_2ND_EXIT_%S+")
- F.add_rc(rc)
- print(F.get_rc_safe())
- atc_set_ars_disable(false)
- atc_send("SM")
- return
- end
-- disregard light exit locos
if F.has_rc(yard_id.."_LIGHT_EXIT") then
F.remove_rc(yard_id.."_LIGHT_EXIT")
diff --git a/auto_yards/nodes/(-2042,19,723).lua b/auto_yards/nodes/(-2042,19,723).lua
new file mode 100644
index 0000000..a0d12bd
--- /dev/null
+++ b/auto_yards/nodes/(-2042,19,723).lua
@@ -0,0 +1,8 @@
+if event.train and atc_arrow then
+ F.remove_rc_match("ARC_LOCOS_%S+")
+ F.remove_rc_match("ARC_WAGONS_%S+")
+ F.remove_rc({
+ "ARC_DEPART",
+ "ARC_FINAL_COLLECT"
+ })
+end \ No newline at end of file
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/(-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