Hello!
I love LTN. I'm deep into a playthrough and all of a sudden, this nonrecoverable error started popping up. Honestly, it happened when I wasn't doing anything with trains. I have attempted to figure out if something is off, but, with this kind of error, you don't get to explore when it happens.
A train is called to pick up coke, then anothere train is called to pick up coke at another station. The first train hits the 5000 mark loading, and the second train is about half way to the station when the error occurs. It could be another train that was unable to be marked for delivery. I don't know. I do know that this error renders this 70 hour save useless unless I can figure out what I did wrong.
[fixed] [1.18.0] Error while running event LogisticTrainNetwork::on_train_changed_state (ID 25)
Moderator: Optera
[fixed] [1.18.0] Error while running event LogisticTrainNetwork::on_train_changed_state (ID 25)
- Attachments
-
- factorio-current.log
- (1.02 MiB) Downloaded 50 times
Re: [fixed] [1.18.0] Error while running event LogisticTrainNetwork::on_train_changed_state (ID 25)
A stop entity was removed just as a train left it.
Added additional check against this for next release.
Edit:
This error only happens when other mods remove stops without raising script_raised_destroy. Otherwise entity removal is handled before train updates.
Added additional check against this for next release.
Edit:
This error only happens when other mods remove stops without raising script_raised_destroy. Otherwise entity removal is handled before train updates.
My Mods: mods.factorio.com
Re: [fixed] [1.18.0] Error while running event LogisticTrainNetwork::on_train_changed_state (ID 25)
Thanks for that! Can you give me a little more insight? When you say a stop entity was removed, what do you mean? If there's something I can do in the minute or two before it fails, then at least I can get back to playing. Thanks for the quick turnaround!
Re: [fixed] [1.18.0] Error while running event LogisticTrainNetwork::on_train_changed_state (ID 25)
Didn't 1.18.1 solve your issue?
My Mods: mods.factorio.com
Re: [fixed] [1.18.0] Error while running event LogisticTrainNetwork::on_train_changed_state (ID 25)
Yes it did! Sorry, I read your message like you'll release it when your next release window opens. I didn't realize it had already been released.
I am curious about the details though. If another mod is not playing nice, I'd like to understand it and report it. Thanks again for the fast fix!
I am curious about the details though. If another mod is not playing nice, I'd like to understand it and report it. Thanks again for the fast fix!
Re: [fixed] [1.18.0] Error while running event LogisticTrainNetwork::on_train_changed_state (ID 25)
I wrote the details in the changelog
Normally removing a stop first raises a remove event before the train state changes. Due to the no longer existing stop the train is now in a different state and a train state changed event is raised.
In your case train state changed was raised for a train leaving a no longer existing stop without a removal event for the stop.
Most likely another mod removed the stop without notifying other mods. Unlike built in removal events, script_raised_destroy has to be called explicitly.
Anyways while LTN is quite robust against it, other mods changing it's entities can result in unexpected behavior.
For non developers:Version: 1.18.1
Date: 2022-12-13
Bugfixes:
- crash when on_train_changed_state is raised for trains stopped at invalid stops. Should only happen if scripts remove stops without raising script_raised_destroy.
Normally removing a stop first raises a remove event before the train state changes. Due to the no longer existing stop the train is now in a different state and a train state changed event is raised.
In your case train state changed was raised for a train leaving a no longer existing stop without a removal event for the stop.
Most likely another mod removed the stop without notifying other mods. Unlike built in removal events, script_raised_destroy has to be called explicitly.
Anyways while LTN is quite robust against it, other mods changing it's entities can result in unexpected behavior.
My Mods: mods.factorio.com