summaryrefslogtreecommitdiff
path: root/auto_yards/nodes
diff options
context:
space:
mode:
authorautocommitter <autocommitter@linux-forks.de>2024-11-03 00:00:02 +0100
committerautocommitter <autocommitter@linux-forks.de>2024-11-03 00:00:02 +0100
commit34fe0d5ffd14919fdb9495e45cfca294b248eefb (patch)
treeb2bf1918d24e8b8adf4a5188d22bb5d12d9b297c /auto_yards/nodes
parent91cc36ecd4e2c68040642dbaf0b0dc46106df61c (diff)
downloadluaatc_envs-34fe0d5ffd14919fdb9495e45cfca294b248eefb.tar.gz
luaatc_envs-34fe0d5ffd14919fdb9495e45cfca294b248eefb.tar.bz2
luaatc_envs-34fe0d5ffd14919fdb9495e45cfca294b248eefb.zip
State at 2024-11-03
Diffstat (limited to 'auto_yards/nodes')
-rw-r--r--auto_yards/nodes/(-524,26,2481).lua2
-rw-r--r--auto_yards/nodes/(-586,26,2504).lua42
-rw-r--r--auto_yards/nodes/(-588,26,2504).lua27
-rw-r--r--auto_yards/nodes/(-590,26,2504).lua42
-rw-r--r--auto_yards/nodes/(-590,26,2534).lua (renamed from auto_yards/nodes/(-588,26,2534).lua)0
-rw-r--r--auto_yards/nodes/(-630,26,2454).lua14
6 files changed, 95 insertions, 32 deletions
diff --git a/auto_yards/nodes/(-524,26,2481).lua b/auto_yards/nodes/(-524,26,2481).lua
index e119505..fb7f7a6 100644
--- a/auto_yards/nodes/(-524,26,2481).lua
+++ b/auto_yards/nodes/(-524,26,2481).lua
@@ -1,3 +1,3 @@
-if F.has_rc("CAN_INTRA_SHUFFLE") then atc_send("S0WD2RS2") return end
+if F.has_rc("CAN_INTRA_SHUFFLE") then atc_send("S0WD2A0RS2") return end
-- EOL
F.lane_EOL("CAN",false) \ No newline at end of file
diff --git a/auto_yards/nodes/(-586,26,2504).lua b/auto_yards/nodes/(-586,26,2504).lua
new file mode 100644
index 0000000..0823436
--- /dev/null
+++ b/auto_yards/nodes/(-586,26,2504).lua
@@ -0,0 +1,42 @@
+-- Cannery Dirt Loading Lane Modified
+local sand_indicator = POS(-572,26,2515) --sand indicator
+
+if F.has_rc("CAN_INTRA_SHUFFLE") then
+ if not atc_arrow then return end
+ if F.has_rc("CAN_CLASS_DIRT_UNLOAD") then -- remove wagons, step the fc, move wagons to sand loading
+ F.remove_rc("CAN_CLASS_DIRT_UNLOAD")
+ F.add_rc({
+ "CAN_HS_W",
+ "CAN_CLASS_SAND_LOAD",
+ "CAN_FROM_DIRT"
+ })
+ step_fc()
+ return
+ end
+ if F.has_rc("CAN_FROM_DIRT") then --leave wagons and return to locostore, shutting down the yard as we go
+ F.remove_rc({
+ "CAN_CLASS_SAND_LOAD",
+ "CAN_FROM_DIRT"
+ })
+ split_off_locomotive("A0B0")
+ F.add_rc({
+ "CAN_HS_W",
+ "CAN_send_to_locostore"
+ })
+ F.indicator(sand_indicator, false) --ensure the sand indicator is off to allow the wagons to load
+ F.indicator(ind,true) --re-enable the notification as we haven't actually left the yard yet
+ F.indicator(S.yards.CAN.active_indicator_pos, false) -- disable the active indicator
+ return
+ end
+ if F.has_rc("CAN_CLASS_SAND_LOAD") then -- remove wagons, step the fc, move wagons to departures
+ F.remove_rc("CAN_CLASS_SAND_LOAD")
+ F.add_rc({
+ "CAN_HS_W", --departures track has Cpl function built in
+ "CAN_CLASS_DEPARTURES"
+ })
+ step_fc()
+ return
+ end
+ return
+end
+F.lane_EOL("CAN",true) \ No newline at end of file
diff --git a/auto_yards/nodes/(-588,26,2504).lua b/auto_yards/nodes/(-588,26,2504).lua
deleted file mode 100644
index 5382804..0000000
--- a/auto_yards/nodes/(-588,26,2504).lua
+++ /dev/null
@@ -1,27 +0,0 @@
--- Cannery Dirt Loading Lane Modified
-local sand_indicator = POS(-572,26,2515) --sand indicator
-
-if F.has_rc("CAN_INTRA_SHUFFLE") then
- if not atc_arrow then return end
- if F.has_rc("CAN_CLASS_DIRT_UNLOAD") then -- remove wagons, step the fc, return the wagons
- F.remove_rc("CAN_CLASS_DIRT_UNLOAD")
- F.add_rc({
- "CAN_HS_W",
- "CAN_CLASS_SAND_LOAD"
- })
- step_fc()
- return
- end
- if F.has_rc("CAN_CLASS_SAND_LOAD") then -- remove wagons, step the fc, move wagons to departures
- F.remove_rc("CAN_CLASS_SAND_LOAD")
- F.add_rc({
- "CAN_HS_W", --departures track has Cpl function built in
- "CAN_CLASS_DEPARTURES"
- })
- step_fc()
- F.indicator(sand_indicator, false)
- return
- end
- return
-end
-F.lane_EOL("CAN",true) \ No newline at end of file
diff --git a/auto_yards/nodes/(-590,26,2504).lua b/auto_yards/nodes/(-590,26,2504).lua
new file mode 100644
index 0000000..0823436
--- /dev/null
+++ b/auto_yards/nodes/(-590,26,2504).lua
@@ -0,0 +1,42 @@
+-- Cannery Dirt Loading Lane Modified
+local sand_indicator = POS(-572,26,2515) --sand indicator
+
+if F.has_rc("CAN_INTRA_SHUFFLE") then
+ if not atc_arrow then return end
+ if F.has_rc("CAN_CLASS_DIRT_UNLOAD") then -- remove wagons, step the fc, move wagons to sand loading
+ F.remove_rc("CAN_CLASS_DIRT_UNLOAD")
+ F.add_rc({
+ "CAN_HS_W",
+ "CAN_CLASS_SAND_LOAD",
+ "CAN_FROM_DIRT"
+ })
+ step_fc()
+ return
+ end
+ if F.has_rc("CAN_FROM_DIRT") then --leave wagons and return to locostore, shutting down the yard as we go
+ F.remove_rc({
+ "CAN_CLASS_SAND_LOAD",
+ "CAN_FROM_DIRT"
+ })
+ split_off_locomotive("A0B0")
+ F.add_rc({
+ "CAN_HS_W",
+ "CAN_send_to_locostore"
+ })
+ F.indicator(sand_indicator, false) --ensure the sand indicator is off to allow the wagons to load
+ F.indicator(ind,true) --re-enable the notification as we haven't actually left the yard yet
+ F.indicator(S.yards.CAN.active_indicator_pos, false) -- disable the active indicator
+ return
+ end
+ if F.has_rc("CAN_CLASS_SAND_LOAD") then -- remove wagons, step the fc, move wagons to departures
+ F.remove_rc("CAN_CLASS_SAND_LOAD")
+ F.add_rc({
+ "CAN_HS_W", --departures track has Cpl function built in
+ "CAN_CLASS_DEPARTURES"
+ })
+ step_fc()
+ return
+ end
+ return
+end
+F.lane_EOL("CAN",true) \ No newline at end of file
diff --git a/auto_yards/nodes/(-588,26,2534).lua b/auto_yards/nodes/(-590,26,2534).lua
index d783815..d783815 100644
--- a/auto_yards/nodes/(-588,26,2534).lua
+++ b/auto_yards/nodes/(-590,26,2534).lua
diff --git a/auto_yards/nodes/(-630,26,2454).lua b/auto_yards/nodes/(-630,26,2454).lua
index 8dd1ff7..4e69484 100644
--- a/auto_yards/nodes/(-630,26,2454).lua
+++ b/auto_yards/nodes/(-630,26,2454).lua
@@ -5,7 +5,8 @@ local sand_indicator = POS(-572,26,2515) --sand indicator
local print_notification = true
local sections = {
- clay_factory = "327479",
+ sand_loading = "199126",
+ dirt_unloading = "541313",
departures = "484515"
}
@@ -28,9 +29,13 @@ local function send_train()
"CANNERY",
"CAN_COLLECT_DEPARTURES"
}
- if section_occupancy(sections.clay_factory)[1] and F.indicator(sand_indicator) then
- -- step the dirt wagons forward into sand wagons
- print("Reshuffling sand export before departure")
+ if section_occupancy(sections.sand_loading)[1] and F.indicator(sand_indicator) then -- move the loaded sand wagons to the departures track when requested
+ base_rc[#base_rc+1] = "CAN_INTRA_SHUFFLE"
+ base_rc[#base_rc+1] = "CAN_HS_W"
+ base_rc[#base_rc+1] = "CAN_HS_W_AC"
+ base_rc[#base_rc+1] = "CAN_CLASS_SAND_LOAD"
+ F.indicator(S.yards.CAN.active_indicator_pos, true) --activate the yard to prevent other trains entering while we're moving around
+ elseif section_occupancy(sections.dirt_unloading)[1] and not section_occupancy(sections.sand_loading)[1] then -- move the unloaded dirt wagons to the sand track if there's room
base_rc[#base_rc+1] = "CAN_INTRA_SHUFFLE"
base_rc[#base_rc+1] = "CAN_HS_W"
base_rc[#base_rc+1] = "CAN_HS_W_AC"
@@ -38,6 +43,7 @@ local function send_train()
F.indicator(S.yards.CAN.active_indicator_pos, true) --activate the yard to prevent other trains entering while we're moving around
elseif section_occupancy(sections.departures)[1] then --collect departures wagons before departing proper
base_rc[#base_rc+1] = "CAN_REENTER_YARD"
+ F.indicator(ind, false)
print("Collecting Departures")
else
base_rc[#base_rc+1] = "CAN_LIGHT_EXIT"