Page 1 of 1

[IDEA] [WIP] Safe stop for trains - looking for feedback

Posted: Thu Apr 06, 2017 4:21 pm
by SilverB1rd
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?

Re: [IDEA] [WIP] Safe stop for trains - looking for feedback

Posted: Fri Apr 07, 2017 6:27 am
by SilverB1rd
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.

Code: Select all

if t.state ~= defines.train_state.arrive_signal or t.speed > -0.00001 and t.speed < 0.00001 then