Page 1 of 1

[Request] Check train station availability by name

Posted: Tue Dec 10, 2019 11:07 pm
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.

Re: [Request] Check train station availability by name

Posted: Wed Dec 11, 2019 1:48 am
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.