I'm a bit stuck on how to configure my trains. My goal is basically: if a train is at a pickup station and a drop-off station needs its freight, it should go there to deliver it. Else it should just stay there. If it gets stuck somewhere else and has no valid goal to go to, it should drive to a depot.
The interrupts that should achieve that are attached. It works if no drop-off station is active. For example, if all coal stations currently have train limit 0, the coal train will stay at its pickup station.
However, if there is a coal station with train limit > 0, but no path to it, the train will leave the station and then go to the depot. I don't want that! It leads to my depot being clogged up with trains full of resources I currently don't need while the trains could have better stuff to do.
What can I change so that no train leaves a station to go somewhere where no path exists?
Interrupts and No Path to Destination
Interrupts and No Path to Destination
- Attachments
-
- Dropoff.png (32.1 KiB) Viewed 158 times
-
- Depot.png (34.73 KiB) Viewed 158 times
Re: Interrupts and No Path to Destination
You try to handle an edge case. It's an error to have a no path condition. Some rail is disconnected or has bad signaling. You need to fix that error. It doesn't happen a driving train will suddenly stop dead in the middle of nowhere with "no path" except the track to the current destination is being destroyed.Setcab wrote: Mon Dec 01, 2025 8:15 pm However, if there is a coal station with train limit > 0, but no path to it, the train will leave the station and then go to the depot. I don't want that! [...]
What can I change so that no train leaves a station to go somewhere where no path exists?
The case the "no path or destination full" condition was primarily built for is that some unexpected material was loaded into the train, the cargo wildcard is used in an interrupt trigger and the destination station name was constructed with that unexpected material where no destination exists at all. For example there was a wooden chest loaded into a wagon for some reason but no wooden chest unloading station exists. In this case the train is redirected to a known station and can either sit there or be unloaded.
If you don't want your trains go to the depot, what is the intended use for your depot? If you want your full trains always stay in the loading station until they're able to deliver, it seems you want to use your depot for empty trains. So include the "empty cargo" condition in the trigger, for example like this:
Re: Interrupts and No Path to Destination
Thank you, adding the "empty train" condition is a good idea, I will try out.
I was aware that this is an edge case, but I want my logic to be robust towards edge and error cases if possible.
I'm currently building a new station in the water and my landfill production could not keep up, that is why there is no path. The tracks aren't laid yet.
I was aware that this is an edge case, but I want my logic to be robust towards edge and error cases if possible.
I'm currently building a new station in the water and my landfill production could not keep up, that is why there is no path. The tracks aren't laid yet.

