I made this mod over a year ago as a dorky proof of concept, ao I'm not surprised it has bugs.
Oh I have seen the code for saving and restoring as much of the wagon's state as possible, and it's incredible. It's like it's prepared for every use case :D
is there anything else you would like me to look at when I revisit it?
I think it could come handy if the train would listen for changes of the setting signal, instead of only checking it on arrival.
Though it could have a performance impact on larger bases, so I think it's only worth the convenience if it can be done with callbacks or if you could make a setting to how often check for the signal.
It could also be useful to have a cooldown for reading the signal (maybe a setting for that too, because it's hard to decide what value would be the best), because otherwise quickly changing circuit systems could tank the UPS
I see that it's basically a bigger change, so only do it if you can afford the time :) I usually keep my service train attached artilleries in manual mode because otherwise it would be dangerous to haul them everywhere I go, but it would be also more convenient to change the mode when needed (because I wouldn't need to send the train to an other stop with the signal), and it could serve as a conditional defense mechanism, like for turning on the automation everywhere, except in the depot.
mod list
I use these:
https://gist.github.com/MPeti1/b11d5f2a55b538437ab186a5c878e6d8
I added compatibility with Krastorio2 in the latest version
Thank you!