[0.12.3]on_train_changed_state messed up by signal
[0.12.3]on_train_changed_state messed up by signal
It seems like the signal messes with the trains state. In the image you can see on the path -> arrive station -> on the path -> wait station (@mm:ss:tt)
From my understanding for a schedule with 2 stations and no red signals between it should only ever change from wait station -> on the path -> arrive station -> etc.
If you remove the signal in the attached save it works as expected.
Attached mod is simply printing the state along with the tick
- Attachments
-
- SmartTrains_0.3.61.zip
- (1.06 KiB) Downloaded 196 times
-
- signalState.zip
- (1.91 MiB) Downloaded 189 times
Re: [0.12.3]on_train_changed_state messed up by signal
Have you tested to make sure it's not simply skipping printing due to repetitive text? Pre-append an incrementing number that's incremented each time it prints to the output and see what gets printed.
Also, what do you expect it to do vs what is it appearing to do now?
Also, what do you expect it to do vs what is it appearing to do now?
If you want to get ahold of me I'm almost always on Discord.
Re: [0.12.3]on_train_changed_state messed up by signal
Rseding91 wrote:Have you tested to make sure it's not simply skipping printing due to repetitive text? Pre-append an incrementing number that's incremented each time it prints to the output and see what gets printed.
Code: Select all
debugDump(util.formattime(event.tick,true).." "..getKeyByValue(defines.trainstate, event.train.state),true)
I played with it some more, now i'm not sure if it's a bug or only a case of me misinterpreting the keys in defines.trainstateRseding91 wrote:Also, what do you expect it to do vs what is it appearing to do now?
What i think they are:
- on_the_path: Train accellerates or runs at max speed
- arrive_station: Train starts breaking before it reaches the station
- wait_station: train is stopped at a station
I found out today that after the first state change from on_the_path to arrive_station every signal that get's reserved (set to yellow) by the train, causes the state to change to on_the_path and after 1 tick back to arrive_station. That's what is confusing me. Could be because the pathfinder does something when a signal gets reserved.
It's really a non issue, very very minor thing, but it's sort of an unexpected behaviour. (In SmartTrains i'm already setting a state called left_station when the state changes from wait station to on the path, if the behaviour becomes an issue i'd probably do something similiar and group the unexpected changes into a state like reserved_signal)
Hope you get what i mean. To be honest i think it's not even worth being looked at unless you're really really bored
Re: [0.12.3]on_train_changed_state messed up by signal
Thank you for the report, this will be fixed in the next release.