I'm working on a mod that gives the player the option to safely stop all trains via a gui. This works by switching trains to manual control only when the train is stopped at a signal or at a train station. This ensures the player can shut down large train networks without having trains stopping in undesirable positions, such as halfway out of or into a station, resulting in a cargo wagon being filled by fuel meant for the locomotives.
Would you find this useful?
As a secondary feature, the ability to Start multiple trains at the same time using filters. Starting defined as switching the train to automatic. I think the most basic filter would be for trains that visit specific train stops. Are there other filters that you would find helpful starting multiple trains?
[IDEA] [WIP] Safe stop for trains - looking for feedback
-
- Inserter
- Posts: 47
- Joined: Fri Mar 17, 2017 9:19 pm
- Contact:
-
- Inserter
- Posts: 47
- Joined: Fri Mar 17, 2017 9:19 pm
- Contact:
Re: [IDEA] [WIP] Safe stop for trains - looking for feedback
I have the basic mod working, will have an alpha release soon.
I did find something strange, sometimes trains will not switch from defines.train_state.arrive_signal to defines.train_state.wait_signal when they are moving toward a red signal. the train speed would continue to get smaller, down past + or - 1e-14, but would never hit zero.
I ended up with a conditional that checks if the train speed drops below a threshold if the train is in the arrive_signal state.
I did find something strange, sometimes trains will not switch from defines.train_state.arrive_signal to defines.train_state.wait_signal when they are moving toward a red signal. the train speed would continue to get smaller, down past + or - 1e-14, but would never hit zero.
I ended up with a conditional that checks if the train speed drops below a threshold if the train is in the arrive_signal state.
Code: Select all
if t.state ~= defines.train_state.arrive_signal or t.speed > -0.00001 and t.speed < 0.00001 then