Enable/disable train stop with script

Place to get help with not working mods / modding interface.
PFQNiet
Filter Inserter
Filter Inserter
Posts: 290
Joined: Sat Sep 05, 2020 7:48 pm
Contact:

Enable/disable train stop with script

Post by PFQNiet »

I can toggle the state of things like assembly machines with "entity.active = false" and it will show a status of "Disabled by script".

But I notice that train stops aren't listed as active ("game.print(stop.active)" shows "false" at all times and it cannot be set to "true"). Is it possible to close a station with script?

I know I can spawn in a constant combinator (invisible if need be) and wire it to the stop but this presents several other problems like let's say I have the combinator output "red = 1" and the stop is enabled if "red = 0", the player could wire their own circuit network to basically say "red * -1, output red" to loop back and override what my script is doing. So I'd prefer to avoid this if possible.
Post Reply

Return to “Modding help”