From 5c7f77725394d47ce0b907aabf885ea207a507bd Mon Sep 17 00:00:00 2001 From: autocommitter Date: Tue, 15 Oct 2024 22:37:32 +0200 Subject: State at 2024-10-15 --- durt/nodes/(-2080,3,822).lua | 55 +++++++++++++++++--------------------------- 1 file changed, 21 insertions(+), 34 deletions(-) (limited to 'durt/nodes/(-2080,3,822).lua') diff --git a/durt/nodes/(-2080,3,822).lua b/durt/nodes/(-2080,3,822).lua index b068713..c9d875f 100644 --- a/durt/nodes/(-2080,3,822).lua +++ b/durt/nodes/(-2080,3,822).lua @@ -1,36 +1,23 @@ -local dir_indicator = POS(-2079,7,803) -local this_dir = true +if not event.train then return end --not sure why we'd need anythign else, but just in case +if not atc_arrow then return end --not used in this case +if not F.has_rc("ARC_LOAD") then return end --not the train for this runaround -__approach_callback_mode = 2 -if event.approach and not event.has_entered then - atc_set_lzb_tsr(2) - atc_set_ars_disable(true) - return +if not F.has_rc("ARC_LOAD_RUNAROUND") then --train has arrived from yard. split and runaround + split_off_locomotive("A0B0",1) + F.add_rc({ + "ARC_LOAD_RUNAROUND", --runaround flag + "ARC_LOAD_HS_N", + "ARC_LOAD_AROUND", -- actual RC to send through runaround + "ARC_LOAD_HS_S", + "ARC_LOAD_HS_S_AC" + }) +else --loco has rejoined from runaround. push through to headshunt, run over loading tracks and prepare for departure + F.remove_rc("ARC_LOAD_AROUND") + F.add_rc({ + "ARC_LOAD_HS_N", + "ARC_LOAD_LOADING", + "ARC_AUTO" + }) end - -if event.train then - if not F.has_rc("ARC_LOAD") then - atc_set_ars_disable(false) - return - end - if F.has_rc("ARC_LOAD_exit") then - atc_set_ars_disable(false) - return - end - if not atc_arrow then - atc_send("S2") - return - end - - if not F.has_rc("ARC_LOAD_rejoin") then - split_at_fc("B0") - F.add_rc("ARC_LOAD_reverse ARC_LOAD_load") - atc_send("A1S2") - F.dir(dir_indicator,this_dir) - else - unset_autocouple() - F.remove_rc({"ARC_LOAD_reverse","ARC_LOAD_rejoin"}) - F.add_rc("ARC_LOAD_exit") - atc_send("B0WRD1S6A1") - end -end \ No newline at end of file +set_route(POS(-2081,4,825),"Headshunt") +atc_send("A1S2") \ No newline at end of file -- cgit v1.2.3