[Request] Check train station availability by name

Place to ask discuss and request the modding support of Factorio. Don't request mods here.
figsoda
Manual Inserter
Manual Inserter
Posts: 2
Joined: Sun Nov 17, 2019 3:18 pm
Contact:

[Request] Check train station availability by name

Post by figsoda »

LuaSurface.train_station_available(station_name :: string) -> boolean

Returns true if there is at least one enabled train stop on this surface with the given station name.
PyroFire
Filter Inserter
Filter Inserter
Posts: 356
Joined: Tue Mar 08, 2016 8:18 am
Contact:

Re: [Request] Check train station availability by name

Post by PyroFire »

figsoda wrote: Tue Dec 10, 2019 11:07 pm LuaSurface.train_station_available(station_name :: string) -> boolean
Train stations are grouped by name, not by surface.
And apparently trains currently make no distinctions for rails or stations on other surfaces, so putting this on LuaSurface doesn't make much sense (i see where you're going with it though).
figsoda wrote: Tue Dec 10, 2019 11:07 pm Returns true if there is at least one enabled train stop on this surface with the given station name.
What's wrong with doing this search manually yourself?
Factorio lua in its current shape is quite capable of doing this no problem without any changes needed.
Post Reply

Return to “Modding interface requests”