Page 1 of 1

Ability to generate LuaRailPath between two rail pieces

Posted: Sat Mar 09, 2019 7:42 am
by Optera
Having LuaRailPath on trains is great, but knowing if a train can path before setting a schedule and how long that path will be would be great.

Currently to find a train closest to a given stop through LuaRailPath we have to:
1) set the destination in train schedule
2) send it off
3) quickly grab the path
4) remove the schedule entry
5) send the train back to the original stop and hope it didn't creep out of the station by now

Proposal:
add a function rail.get_path(rail) -> LuaRailPath between two rail pieces or nil

Re: Ability to generate LuaRailPath between two rail pieces

Posted: Sat Mar 09, 2019 7:19 pm
by themadgunman
Agreed, knowing if there is a valid path between two rail segments before sending a train would indeed be very useful

Re: Ability to generate LuaRailPath between two rail pieces

Posted: Sun Mar 10, 2019 2:18 am
by ospeovedos
Agreed x2! I was just going to post a feature request / bug report for LTN that trains get assigned for stops they can't reach. If this makes it into LTN then I won't have to redesign my depots :P

Re: Ability to generate LuaRailPath between two rail pieces

Posted: Tue Mar 12, 2019 9:40 am
by Godmave
+11!

Would love to have this too.

Greetings from Vietnam :)