diff options
author | autocommitter <autocommitter@linux-forks.de> | 2024-10-31 00:00:02 +0100 |
---|---|---|
committer | autocommitter <autocommitter@linux-forks.de> | 2024-10-31 00:00:02 +0100 |
commit | c019cfb8391dae72a1480e6d8ae8f06ff3d702ee (patch) | |
tree | 046a04c226916b6e9ba46ea675ddf649b7194ad9 | |
parent | 22e2624c6c07bc7b4d51bac1365b22c8ed27bbc2 (diff) | |
download | luaatc_envs-c019cfb8391dae72a1480e6d8ae8f06ff3d702ee.tar.gz luaatc_envs-c019cfb8391dae72a1480e6d8ae8f06ff3d702ee.tar.bz2 luaatc_envs-c019cfb8391dae72a1480e6d8ae8f06ff3d702ee.zip |
State at 2024-10-31
-rw-r--r-- | auto_yards/nodes/(-1969,16,824).lua | 1 | ||||
-rw-r--r-- | auto_yards/nodes/(-1969,16,852).lua | 1 | ||||
-rw-r--r-- | auto_yards/nodes/(-588,26,2504).lua | 26 | ||||
-rw-r--r-- | durt/nodes/(-1419,11,-2545).lua | 12 | ||||
-rw-r--r-- | durt/nodes/(-1426,11,-2548).lua | 0 | ||||
-rw-r--r-- | durt/nodes/(-1433,11,-2563).lua | 26 | ||||
-rw-r--r-- | durt/nodes/(-1442,11,-2568).lua | 30 | ||||
-rw-r--r-- | durt/nodes/(-1446,11,-2568).lua | 7 | ||||
-rw-r--r-- | durt/nodes/(-1457,11,-2573).lua | 22 | ||||
-rw-r--r-- | durt/nodes/(-1468,15,-2551).lua | 0 |
10 files changed, 75 insertions, 50 deletions
diff --git a/auto_yards/nodes/(-1969,16,824).lua b/auto_yards/nodes/(-1969,16,824).lua new file mode 100644 index 0000000..4503e25 --- /dev/null +++ b/auto_yards/nodes/(-1969,16,824).lua @@ -0,0 +1 @@ +F.lane_EOL("ARC",true)
\ No newline at end of file diff --git a/auto_yards/nodes/(-1969,16,852).lua b/auto_yards/nodes/(-1969,16,852).lua new file mode 100644 index 0000000..89349e3 --- /dev/null +++ b/auto_yards/nodes/(-1969,16,852).lua @@ -0,0 +1 @@ +F.lane_EOL("ARC",false)
\ No newline at end of file diff --git a/auto_yards/nodes/(-588,26,2504).lua b/auto_yards/nodes/(-588,26,2504).lua index 46e3050..cb800d9 100644 --- a/auto_yards/nodes/(-588,26,2504).lua +++ b/auto_yards/nodes/(-588,26,2504).lua @@ -1,2 +1,26 @@ +function tprint (tbl, indent) + local s = "" + if not indent then indent = 0 end + for k, v in pairs(tbl) do + local formatting = string.rep(" ", indent) .. "['"..k .. "']= " + if type(v) == "table" then + s = s .. formatting .. "{"..tprint(v, indent+1).."}" + else + s = s .. formatting .. tostring(v) + end + s = s .. ", " + end + return s +end + +local str = "CAN_SB!S27!SAND_UNLOAD!DIRT_LOAD!S27_NB!CANNERY!DIRT_UNLOAD!SAND_LOAD" +local fc_table = {""} +for i=2,train_length() do +table.insert(fc_table,str) +end +set_fc(fc_table, true) +print(tprint(get_fc())) + + -- EOL -F.lane_EOL("CAN",true)
\ No newline at end of file +--F.lane_EOL("CAN",true)
\ No newline at end of file diff --git a/durt/nodes/(-1419,11,-2545).lua b/durt/nodes/(-1419,11,-2545).lua new file mode 100644 index 0000000..c17e7b9 --- /dev/null +++ b/durt/nodes/(-1419,11,-2545).lua @@ -0,0 +1,12 @@ +-- S27 Export Arrivals Splitter +if event.train and atc_arrow then + if not F.has_rc("S27_EXPORT_ACTIVE") then return end + local fc = split_at_fc("A0B0",1) or "DEPART" + F.add_rc({ + "S27_EXP_HS_N", + "S27_"..fc + }) + if fc == "DEPART" then + F.add_rc("S27_EXP_HS_N_AC") + end +end
\ No newline at end of file diff --git a/durt/nodes/(-1426,11,-2548).lua b/durt/nodes/(-1426,11,-2548).lua new file mode 100644 index 0000000..e69de29 --- /dev/null +++ b/durt/nodes/(-1426,11,-2548).lua diff --git a/durt/nodes/(-1433,11,-2563).lua b/durt/nodes/(-1433,11,-2563).lua index 7ac821e..9bccb9e 100644 --- a/durt/nodes/(-1433,11,-2563).lua +++ b/durt/nodes/(-1433,11,-2563).lua @@ -1,25 +1 @@ -__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("S27_EXP_WAIT") then - atc_set_ars_disable(false) - return - end - atc_send("S0") - return -end - -if event.ext_int and atc_id then - F.remove_rc("S27_REV_West S27_EXP_WAIT") - F.add_rc("S27_REV_East S27_EXP_DEPART") - atc_send("S3") - atc_set_ars_disable(false) - set_autocouple() - return -end
\ No newline at end of file +F.remove_rc("S27_EXP_AROUND")
\ No newline at end of file diff --git a/durt/nodes/(-1442,11,-2568).lua b/durt/nodes/(-1442,11,-2568).lua index 6888f6b..6b7502e 100644 --- a/durt/nodes/(-1442,11,-2568).lua +++ b/durt/nodes/(-1442,11,-2568).lua @@ -1,17 +1,25 @@ -local ind = POS(-1444,10,-2546) +--S27 Export Arrivals if event.train and atc_arrow then - if not F.has_rc("S27_SHUNTER") then - step_fc() - split_off_locomotive("BBA0") - F.add_rc("S27_REV_West S27_EXP_WAIT S27_EXP_COLLECT") - F.indicator(ind,true) + if not F.has_rc("S27_SHUNTER") then return end + if train_length() == 1 then + F.add_rc({ + "S27_LOCOSTORE", + "S27_EXP_HS_N", + "S27_EXP_AROUND", + "S27_EXP_HS_S" + }) + atc_send("S0WD3RS3") return end - unset_autocouple() - atc_send("A0BB") - if train_length() > 2 then -- if length > 2 it would try to discouple the nose - split_at_index(train_length()-1,"BBWRD2S3A1") + if not F.has_rc("S27_EXPORT_ACTIVE") then + split_off_locomotive("A0B0",1) + F.add_rc({ + "S27_EXPORT_ACTIVE", + "S27_EXP_HS_S", + "S27_EXP_AROUND", + }) return end - atc_send("BBWRD2S3A1") + atc_send("S0WD3RS1") + return end
\ No newline at end of file diff --git a/durt/nodes/(-1446,11,-2568).lua b/durt/nodes/(-1446,11,-2568).lua index bca38cc..e69de29 100644 --- a/durt/nodes/(-1446,11,-2568).lua +++ b/durt/nodes/(-1446,11,-2568).lua @@ -1,7 +0,0 @@ -if event.train and atc_arrow then - if not F.has_rc("S27_SHUNTER") then return end - atc_reset() - atc_set_ars_disable(true) - atc_send("BB") - split_at_index(train_length(),"S0WRD1S3A1") -end
\ No newline at end of file diff --git a/durt/nodes/(-1457,11,-2573).lua b/durt/nodes/(-1457,11,-2573).lua index 8f984b2..cb9eb3c 100644 --- a/durt/nodes/(-1457,11,-2573).lua +++ b/durt/nodes/(-1457,11,-2573).lua @@ -1,17 +1,27 @@ -local rev_rc = "S27_REV_West" -local rm_rc = false - +-- Automatic bouncer for headshunts, assuming longer headshunt than train length. Arrow points into headshunt +local rev_rc = "S27_EXP_HS_S" +local rm_rc = true +local autocouple = "S27_EXP_HS_S_AC" +local rm_cpl_rc = true __approach_callback_mode = 1 if event.approach and not event.has_entered then - atc_set_lzb_tsr(1) + atc_set_lzb_tsr(3) atc_set_ars_disable(true) return end -if event.train and atc_arrow then - if not F.has_rc(rev_rc) then +if event.train then + if not atc_arrow then --train has bounced + if F.has_rc(autocouple) then + atc_send("CplS0WD2S1") + if rm_cpl_rc then F.remove_rc({autocouple}) end + end + return + end + + if not F.has_rc(rev_rc) then --not our train. disregard atc_set_ars_disable(false) return end diff --git a/durt/nodes/(-1468,15,-2551).lua b/durt/nodes/(-1468,15,-2551).lua new file mode 100644 index 0000000..e69de29 --- /dev/null +++ b/durt/nodes/(-1468,15,-2551).lua |