diff options
23 files changed, 33 insertions, 34 deletions
diff --git a/auto_yards/init_code.lua b/auto_yards/init_code.lua index d2f0c74..30b1be9 100644 --- a/auto_yards/init_code.lua +++ b/auto_yards/init_code.lua @@ -120,32 +120,6 @@ F.remove_rc_match = function(rc_list) -- rc_list = pattern string, single entry, return rm end -------------------------------------------------------------------------------------- --- Superseded by universal indicator function. to be updated in trackside functions --- F.error = function(set) - -- local error_indicator = POS(-4025,13,-2671) - -- if set ~= nil then - -- setstate(error_indicator,(set and "on") or "off") - -- end - -- return (getstate(error_indicator) == "on") or false --- end - --- F.yard_active = function(set) --if set == true then yard = active - -- local yard_indicator = POS(-4025,14,-2659) - -- if set ~= nil then - -- setstate(yard_indicator,(set and "on") or "off") - -- end - -- return (getstate(yard_indicator) == "on") or false --- end - --- F.dir = function(set) -- if set == true then dir = pointing north - -- local dir_indicator = POS(-4025,13,-2665) - -- if set ~= nil then - -- setstate(dir_indicator,(set and "on") or "off") - -- end - -- return (getstate(dir_indicator) == "on") or false --- end - ---------------------------------------------------------------------------------------------- -- Trackside Functions F.yard_arrival = function(yard_id,this_dir) -- arrow points towards yard @@ -202,15 +176,18 @@ F.classification = function(yard_id, this_dir) -- arrow points towards headshunt F.remove_rc({yard_id.."_AROUND"}) if not F.get_rc_safe():match(yard_id.."_LOCOS_%d+") or not F.get_rc_safe():match(yard_id.."_WAGONS_%d+") then local full_length = train_length() - split_off_locomotive("A0B0") -- train will end up going through headshunt no matter what. there shouldn't be any trains entering that pass straight through. - if train_length() == full_length then --train is either only here for collection or there's no FC's in the wagons. can't differentiate - local lane = F.get_rc_safe():match(yard_id.."_COLLECT_(%S+)") or "" - F.add_rc({yard_id.."_LAST_CLASS",yard_id.."_CLASS_"..lane}) -- direct train to correct lane for collection - else --identify and save loco:wagon ratio, then bounce back from headshunt. it's easier than trying to reconnect - F.add_rc({yard_id.."_LOCOS_"..train_length(), yard_id.."_WAGONS_"..(full_length-train_length())}) + split_off_locomotive("A0B0") + local loco_count = train_length() + local wagon_count = 0 + if full_length > loco_count then + wagon_count = full_length - loco_count end - - + F.add_rc({yard_id.."_LOCOS_"..loco_count, yard_id.."_WAGONS_"..wagon_count}) + --[[ + train will end up going through headshunt no matter what + there shouldn't be any trains entering that pass straight through the yard + any that do should run under the _NOSHUNT rc + ]]-- if not F.has_rc(yard_id.."_RTS") then F.add_rc({yard_id.."_HEADSHUNT",yard_id.."_PICKUP"}) else diff --git a/auto_yards/nodes/(-3967,12,-2646).lua b/auto_yards/nodes/(-3967,12,-2646).lua new file mode 100644 index 0000000..b432d60 --- /dev/null +++ b/auto_yards/nodes/(-3967,12,-2646).lua @@ -0,0 +1 @@ +F.headshunt_exit("TY",true)
\ No newline at end of file diff --git a/auto_yards/nodes/(-4011,12,-2642).lua b/auto_yards/nodes/(-4011,12,-2642).lua new file mode 100644 index 0000000..b2ecbe1 --- /dev/null +++ b/auto_yards/nodes/(-4011,12,-2642).lua @@ -0,0 +1 @@ +F.yard_arrival("TY",false)
\ No newline at end of file diff --git a/auto_yards/nodes/(-4012,12,-2646).lua b/auto_yards/nodes/(-4012,12,-2646).lua new file mode 100644 index 0000000..7cbd912 --- /dev/null +++ b/auto_yards/nodes/(-4012,12,-2646).lua @@ -0,0 +1 @@ +F.headshunt_yard("TY",true)
\ No newline at end of file diff --git a/auto_yards/nodes/(-4027,12,-2655).lua b/auto_yards/nodes/(-4027,12,-2655).lua new file mode 100644 index 0000000..8b9478c --- /dev/null +++ b/auto_yards/nodes/(-4027,12,-2655).lua @@ -0,0 +1 @@ +F.classification("TY",true)
\ No newline at end of file diff --git a/auto_yards/nodes/(-4027,12,-2731).lua b/auto_yards/nodes/(-4027,12,-2731).lua new file mode 100644 index 0000000..5a84c84 --- /dev/null +++ b/auto_yards/nodes/(-4027,12,-2731).lua @@ -0,0 +1 @@ +F.classification("TY",false)
\ No newline at end of file diff --git a/auto_yards/nodes/(-4031,12,-2655).lua b/auto_yards/nodes/(-4031,12,-2655).lua new file mode 100644 index 0000000..3a0fd2c --- /dev/null +++ b/auto_yards/nodes/(-4031,12,-2655).lua @@ -0,0 +1 @@ +F.lane_EOL("TY",true)
\ No newline at end of file diff --git a/auto_yards/nodes/(-4031,12,-2731).lua b/auto_yards/nodes/(-4031,12,-2731).lua new file mode 100644 index 0000000..9b42d4c --- /dev/null +++ b/auto_yards/nodes/(-4031,12,-2731).lua @@ -0,0 +1 @@ +F.lane_EOL("TY",false)
\ No newline at end of file diff --git a/auto_yards/nodes/(-4035,12,-2655).lua b/auto_yards/nodes/(-4035,12,-2655).lua new file mode 100644 index 0000000..3a0fd2c --- /dev/null +++ b/auto_yards/nodes/(-4035,12,-2655).lua @@ -0,0 +1 @@ +F.lane_EOL("TY",true)
\ No newline at end of file diff --git a/auto_yards/nodes/(-4035,12,-2731).lua b/auto_yards/nodes/(-4035,12,-2731).lua new file mode 100644 index 0000000..9b42d4c --- /dev/null +++ b/auto_yards/nodes/(-4035,12,-2731).lua @@ -0,0 +1 @@ +F.lane_EOL("TY",false)
\ No newline at end of file diff --git a/auto_yards/nodes/(-4039,12,-2655).lua b/auto_yards/nodes/(-4039,12,-2655).lua new file mode 100644 index 0000000..3a0fd2c --- /dev/null +++ b/auto_yards/nodes/(-4039,12,-2655).lua @@ -0,0 +1 @@ +F.lane_EOL("TY",true)
\ No newline at end of file diff --git a/auto_yards/nodes/(-4039,12,-2731).lua b/auto_yards/nodes/(-4039,12,-2731).lua new file mode 100644 index 0000000..9b42d4c --- /dev/null +++ b/auto_yards/nodes/(-4039,12,-2731).lua @@ -0,0 +1 @@ +F.lane_EOL("TY",false)
\ No newline at end of file diff --git a/auto_yards/nodes/(-4043,12,-2655).lua b/auto_yards/nodes/(-4043,12,-2655).lua new file mode 100644 index 0000000..3a0fd2c --- /dev/null +++ b/auto_yards/nodes/(-4043,12,-2655).lua @@ -0,0 +1 @@ +F.lane_EOL("TY",true)
\ No newline at end of file diff --git a/auto_yards/nodes/(-4043,12,-2731).lua b/auto_yards/nodes/(-4043,12,-2731).lua new file mode 100644 index 0000000..9b42d4c --- /dev/null +++ b/auto_yards/nodes/(-4043,12,-2731).lua @@ -0,0 +1 @@ +F.lane_EOL("TY",false)
\ No newline at end of file diff --git a/auto_yards/nodes/(-4047,12,-2655).lua b/auto_yards/nodes/(-4047,12,-2655).lua new file mode 100644 index 0000000..3a0fd2c --- /dev/null +++ b/auto_yards/nodes/(-4047,12,-2655).lua @@ -0,0 +1 @@ +F.lane_EOL("TY",true)
\ No newline at end of file diff --git a/auto_yards/nodes/(-4047,12,-2731).lua b/auto_yards/nodes/(-4047,12,-2731).lua new file mode 100644 index 0000000..9b42d4c --- /dev/null +++ b/auto_yards/nodes/(-4047,12,-2731).lua @@ -0,0 +1 @@ +F.lane_EOL("TY",false)
\ No newline at end of file diff --git a/auto_yards/nodes/(-4051,12,-2655).lua b/auto_yards/nodes/(-4051,12,-2655).lua new file mode 100644 index 0000000..3a0fd2c --- /dev/null +++ b/auto_yards/nodes/(-4051,12,-2655).lua @@ -0,0 +1 @@ +F.lane_EOL("TY",true)
\ No newline at end of file diff --git a/auto_yards/nodes/(-4051,12,-2731).lua b/auto_yards/nodes/(-4051,12,-2731).lua new file mode 100644 index 0000000..9b42d4c --- /dev/null +++ b/auto_yards/nodes/(-4051,12,-2731).lua @@ -0,0 +1 @@ +F.lane_EOL("TY",false)
\ No newline at end of file diff --git a/auto_yards/nodes/(-4055,12,-2655).lua b/auto_yards/nodes/(-4055,12,-2655).lua new file mode 100644 index 0000000..3a0fd2c --- /dev/null +++ b/auto_yards/nodes/(-4055,12,-2655).lua @@ -0,0 +1 @@ +F.lane_EOL("TY",true)
\ No newline at end of file diff --git a/auto_yards/nodes/(-4055,12,-2731).lua b/auto_yards/nodes/(-4055,12,-2731).lua new file mode 100644 index 0000000..9b42d4c --- /dev/null +++ b/auto_yards/nodes/(-4055,12,-2731).lua @@ -0,0 +1 @@ +F.lane_EOL("TY",false)
\ No newline at end of file diff --git a/auto_yards/nodes/(-4100,12,-2742).lua b/auto_yards/nodes/(-4100,12,-2742).lua new file mode 100644 index 0000000..efa846b --- /dev/null +++ b/auto_yards/nodes/(-4100,12,-2742).lua @@ -0,0 +1 @@ +F.headshunt_yard("TY",false)
\ No newline at end of file diff --git a/auto_yards/nodes/(-4100,12,-2745).lua b/auto_yards/nodes/(-4100,12,-2745).lua new file mode 100644 index 0000000..3282978 --- /dev/null +++ b/auto_yards/nodes/(-4100,12,-2745).lua @@ -0,0 +1 @@ +F.yard_arrival("TY",true)
\ No newline at end of file diff --git a/auto_yards/nodes/(-4167,12,-2742).lua b/auto_yards/nodes/(-4167,12,-2742).lua new file mode 100644 index 0000000..2630b84 --- /dev/null +++ b/auto_yards/nodes/(-4167,12,-2742).lua @@ -0,0 +1 @@ +F.headshunt_exit("TY",false)
\ No newline at end of file |