Way to stop trains from stopping when stations goes disabled
Way to stop trains from stopping when stations goes disabled
So. I have a factory using forward artillery bases to keep the biters away, those bases are wired up with logic to enable/disable the station depening on if it lacks ammo/resources. Using a trainlimit at 5 to keep the trains coming when needing ammo etc, but as soon as the station gets disabled the trains that was on their way stops dead on the tracks blocking traffic. Is there some way to get them to return home (next station) when a tragetstation gets disabled?
Re: Way to stop trains from stopping when stations goes disabled
Don't disable. Set train limit to 0 instead
Re: Way to stop trains from stopping when stations goes disabled
What does the train and its schedule say when it stops? The schedule will skip to the depot if all the resupply stops are disabled. If the train says "No path", then you need to build a turnaround loop at the resupply station so that it can get back to the depot.
If the train says "Destination full", then it's because another resupply station is enabled but already has enough trains. There's nothing you can do to make the stopped train skip back to the depot schedule entry. You have to let it get to the destination (by setting limit=0 and not disabling any of them).
If the train says "Destination full", then it's because another resupply station is enabled but already has enough trains. There's nothing you can do to make the stopped train skip back to the depot schedule entry. You have to let it get to the destination (by setting limit=0 and not disabling any of them).
My mods: Multiple Unit Train Control, Smart Artillery Wagons
Maintainer of Vehicle Wagon 2, Cargo Ships, Honk
Maintainer of Vehicle Wagon 2, Cargo Ships, Honk
Re: Way to stop trains from stopping when stations goes disabled
In addition, if the stop the train was heading to is disabled, but there is still at least one enabled stop of the same name, it will try to go to a different stop (rather than the depot), possibly with the same result ("No path"). Practically speaking, to be certain you will never have a problem when disabling non-unique stops you should ensure your rail network has a path from every point to every other point.
Nosferatu's suggestion of setting the train limit to zero instead of disabling the stop gives a less strict requirement because trains will always continue to a enabled stop with a train limit, even if the limit is subsequently reduced.
Re: Way to stop trains from stopping when stations goes disabled
Ah sorry, been off from Factiorio for a while.
The train stops dead in the tracks with a no path error (got plenty and plenty of roundabouts and whatnot), Hadn't thought about setting trainlimit to 0 though, gonna give that a try next time the need to harass biters occur!
The train stops dead in the tracks with a no path error (got plenty and plenty of roundabouts and whatnot), Hadn't thought about setting trainlimit to 0 though, gonna give that a try next time the need to harass biters occur!
Re: Way to stop trains from stopping when stations goes disabled
If you have one train servicing several resupply stations, you can safely use Enable/Disable on the resupply stations as long as the supply station you load the train at is always on. NEVER turn that supply station off.
If you are using multiple trains to service those resupply stations, then do NOT use the Enable/Disable (you get the “thundering herd” when one station turns on if you do). Use the Train Stop Limit to call for a single train instead.
If you are using multiple trains to service those resupply stations, then do NOT use the Enable/Disable (you get the “thundering herd” when one station turns on if you do). Use the Train Stop Limit to call for a single train instead.
Re: Way to stop trains from stopping when stations goes disabled
With a small bit of circuitry (1 combinator per station), you can proactively set the train limit of a station exactly to the amount of trains this station is able to load or unload. And never need to enable/disable with its interesting side effects.
How it works:
You know the station capacity and the train capacity. You also know how much material is currently stored in a station.
For loading stations, divide current station material by train capacity. The result can be set as train limit, because this is the amount of trains that can be filled with the current amount of stored material.
For unloading stations, get the free space by subtracting currently stored material from station capacity. Divide the free space by train capacity. The result can be set as train limit, because this is the amount of full trains that can be emptied into the station without the need to wait.
There are blueprint examples for this deep in the forum, but I guess the fun is to create this by oneself.
How it works:
You know the station capacity and the train capacity. You also know how much material is currently stored in a station.
For loading stations, divide current station material by train capacity. The result can be set as train limit, because this is the amount of trains that can be filled with the current amount of stored material.
For unloading stations, get the free space by subtracting currently stored material from station capacity. Divide the free space by train capacity. The result can be set as train limit, because this is the amount of full trains that can be emptied into the station without the need to wait.
There are blueprint examples for this deep in the forum, but I guess the fun is to create this by oneself.
Re: Way to stop trains from stopping when stations goes disabled
That's two combinators . But it is a very simple and effective system for trains carrying a single item. The only caveat is that you must ensure buffers for each wagon are emptied evenly.Tertius wrote: ↑Sat May 28, 2022 11:44 am With a small bit of circuitry (1 combinator per station)
[...]
For unloading stations, get the free space by subtracting currently stored material from station capacity. Divide the free space by train capacity. The result can be set as train limit, because this is the amount of full trains that can be emptied into the station without the need to wait.
I note you don't need to use the full station capacity in the subtraction; it is just an upper limit. A lower value can be useful if the item is in short supply and/or the buffer is emptied at a low rate.
Re: Way to stop trains from stopping when stations goes disabled
You actually need one Arithmethic combinator and one Constant combinator for the unloading station. In the constant combinator, you save the negative value of station capacity and feed this and the wire from the chests to the input of the Arithmetic combinator, so you get the negative of the free space. You divide this by the negative value of the train capacity (value given directly in the Arithmetic combinator), so minus times minus makes plus, and this is the positive value you need.
It looks like this:
It seems I didn't actually made a similar loading station, instead I hardcoded a train limit of 1 for all of my loading stations, because my train concept defines that every loading station should always have a train waiting that leaves the moment enough material for a full train accumulated.
It looks like this:
It seems I didn't actually made a similar loading station, instead I hardcoded a train limit of 1 for all of my loading stations, because my train concept defines that every loading station should always have a train waiting that leaves the moment enough material for a full train accumulated.
Re: Way to stop trains from stopping when stations goes disabled
Thanks everyone for the help
Using train stop limits fixed the issue so currenlty migrating all the old outposts to use that logic!
Using train stop limits fixed the issue so currenlty migrating all the old outposts to use that logic!