Ability to generate LuaRailPath between two rail pieces

Place to ask discuss and request the modding support of Factorio. Don't request mods here.
User avatar
Optera
Smart Inserter
Smart Inserter
Posts: 2920
Joined: Sat Jun 11, 2016 6:41 am
Contact:

Ability to generate LuaRailPath between two rail pieces

Post 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
User avatar
themadgunman
Inserter
Inserter
Posts: 47
Joined: Wed Jan 18, 2017 5:07 pm
Contact:

Re: Ability to generate LuaRailPath between two rail pieces

Post by themadgunman »

Agreed, knowing if there is a valid path between two rail segments before sending a train would indeed be very useful
ospeovedos
Burner Inserter
Burner Inserter
Posts: 17
Joined: Mon Aug 22, 2016 3:42 pm
Contact:

Re: Ability to generate LuaRailPath between two rail pieces

Post 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
User avatar
Godmave
Long Handed Inserter
Long Handed Inserter
Posts: 89
Joined: Tue Nov 15, 2016 3:52 pm
Contact:

Re: Ability to generate LuaRailPath between two rail pieces

Post by Godmave »

+11!

Would love to have this too.

Greetings from Vietnam :)
Post Reply

Return to “Modding interface requests”