Train Condition - Cargo Not Full

Post your ideas and suggestions how to improve the game.

Moderator: ickputzdirwech

TheBuzzSaw
Burner Inserter
Burner Inserter
Posts: 13
Joined: Fri Sep 08, 2023 4:02 pm
Contact:

Train Condition - Cargo Not Full

Post by TheBuzzSaw »

TL;DR
There is a "cargo full" train condition. We need a "cargo not full" train condition for interrupts and train stops.
What?
We need a condition to check to see if the train has any room in it whatsoever.

The conditions "Full cargo", "Has cargo", and "Empty cargo" are present already. Some other "Cargo not full" option would fit well here in the interface.
Screenshot From 2026-01-19 10-14-33.png
Screenshot From 2026-01-19 10-14-33.png (136.41 KiB) Viewed 606 times
Alternatively, judging by this list, it also seems it might just be time to add a huge NOT checkbox/operator to negate any of the options. Then the list would cut in half, but that could be saved for another time.
Why?
It would round out the possible set evaluations for generic cargo loads. "Has cargo" represents "any". "Empty cargo" represents "not-any". "Full cargo" represents "all". We're missing the "not-all" evaluation!

I was trying to make a train interrupt. I see the conditions "Empty cargo", "Full cargo", and "Has cargo". However, I need the condition "Cargo not full". I was able to work around this by choosing "Item count" and setting the exact range, but that prevents me from making a generic interrupt that I can use across all trains. The other conditions are insufficient for what I was building.
robot256
Smart Inserter
Smart Inserter
Posts: 1326
Joined: Sun Mar 17, 2019 1:52 am
Contact:

Re: Train Condition - Cargo Not Full

Post by robot256 »

Just curious, what were you building? You want an interrupt to trigger when the train is partially full? Would that not trigger most of the time, i.e. as soon as one item was removed from a full train or one item was added to an empty train?
My mods: Multiple Unit Train Control, RGB Pipes, Shipping Containers, Rocket Log, Smart Artillery Wagons.
Maintainer of Auto Deconstruct, Cargo Ships, Vehicle Wagon, Honk, Shortwave.
fpx007
Inserter
Inserter
Posts: 26
Joined: Wed Oct 23, 2024 1:02 am
Contact:

Re: Train Condition - Cargo Not Full

Post by fpx007 »

robot256 wrote: Tue Jan 20, 2026 4:39 am Just curious, what were you building? You want an interrupt to trigger when the train is partially full? Would that not trigger most of the time, i.e. as soon as one item was removed from a full train or one item was added to an empty train?
Basically, I also want such feature. My intended application is that when a mine is almost depleted, the last load would probably not be full. Thus, after a timeout, I can detect and fill the partially full cargo.

Actually, since the "and" and "or" operators are already in game, why don't we have the "not" operator. Such operator can solve a lot of related isuues at minimal effort.
Kyralessa
Filter Inserter
Filter Inserter
Posts: 813
Joined: Thu Sep 29, 2016 5:58 pm
Contact:

Re: Train Condition - Cargo Not Full

Post by Kyralessa »

fpx007 wrote: Tue Jan 20, 2026 7:23 am Basically, I also want such feature. My intended application is that when a mine is almost depleted, the last load would probably not be full. Thus, after a timeout, I can detect and fill the partially full cargo.
Can't you use inactivity to make the train depart with the last partial load?
fpx007
Inserter
Inserter
Posts: 26
Joined: Wed Oct 23, 2024 1:02 am
Contact:

Re: Train Condition - Cargo Not Full

Post by fpx007 »

Kyralessa wrote: Tue Jan 20, 2026 8:41 am
fpx007 wrote: Tue Jan 20, 2026 7:23 am Basically, I also want such feature. My intended application is that when a mine is almost depleted, the last load would probably not be full. Thus, after a timeout, I can detect and fill the partially full cargo.
Can't you use inactivity to make the train depart with the last partial load?
The departure is not the issue here, as I already said using "a timeout" for it. The issue is to check the state of cargo(s) at a departure, and thus determining where the train should go. I can only set timeout/inactivity as a condition for departures, but not a trigger for interruptions.
Tertius
Smart Inserter
Smart Inserter
Posts: 1548
Joined: Fri Mar 19, 2021 5:58 pm
Contact:

Re: Train Condition - Cargo Not Full

Post by Tertius »

I have such a timeout, and the train will leave with partial cargo, and it will be unloaded along with all the other trains. There's no issue with a partially filled train showing up at unload once every few days. Or is there?
fpx007
Inserter
Inserter
Posts: 26
Joined: Wed Oct 23, 2024 1:02 am
Contact:

Re: Train Condition - Cargo Not Full

Post by fpx007 »

Tertius wrote: Tue Jan 20, 2026 12:00 pm I have such a timeout, and the train will leave with partial cargo, and it will be unloaded along with all the other trains. There's no issue with a partially filled train showing up at unload once every few days. Or is there?
Yes, there is. (And actually, this is a serious issue.) Because the length of belts from the output side of balancer to loader segments next to different cargos are usually not the same, when the mine has just been depleted, different cargos will be loaded with different amount of resource. If there isn't another filling procedure (so all cargos are once again loaded fully, i.e. they are loaded with same amount of resources), the unbalanced status will be carried to unloading station, and break the balance there,. The unbalance in unloading stations will reduce the unloading efficiency or even make them fail to work properly.

TL;DR: Partially loading will create unbalanced cargos, and possibly cause unpredictable consequences.
robot256
Smart Inserter
Smart Inserter
Posts: 1326
Joined: Sun Mar 17, 2019 1:52 am
Contact:

Re: Train Condition - Cargo Not Full

Post by robot256 »

What if you flip the script? Have the train constantly go to mines, then interrupt triggers when cargo is full and send it to unloading. Thanks for the explanation, I will not hijack your thread anymore.
My mods: Multiple Unit Train Control, RGB Pipes, Shipping Containers, Rocket Log, Smart Artillery Wagons.
Maintainer of Auto Deconstruct, Cargo Ships, Vehicle Wagon, Honk, Shortwave.
Tertius
Smart Inserter
Smart Inserter
Posts: 1548
Joined: Fri Mar 19, 2021 5:58 pm
Contact:

Re: Train Condition - Cargo Not Full

Post by Tertius »

I have balancing at the loading station as well as at the unloading station, so this will correct itself or not show up to begin with. This is a major feature of a robust production chain start. I added explicit balancing, because full trains alone don't guarantee everything will stay balanced. Full trains help to keep the balance, but it will get eventually unbalanced in the long run. Balance is still fragile.

If there was a feature to add to the train system, it would be a means for the universal train approach to return a partially filled train to a different station with the same name and with the same cargo, so filling can continue with the same cargo. This would help my approach (my trains can leave unloading early if one wagon is empty but others not to keep buffer chest balance) as well as your approach (completely fill an almost full train at another loading station).

Currently, a partially filled train can only be filled completely at a different station if there are separate train groups and separate loading station names for each cargo type, so the train will find an appropriate station to continue filling.
fpx007
Inserter
Inserter
Posts: 26
Joined: Wed Oct 23, 2024 1:02 am
Contact:

Re: Train Condition - Cargo Not Full

Post by fpx007 »

robot256 wrote: Tue Jan 20, 2026 12:29 pm What if you flip the script? Have the train constantly go to mines, then interrupt triggers when cargo is full and send it to unloading. Thanks for the explanation, I will not hijack your thread anymore.
This will probably not work, because you don't always need to unload goods, i.e. sometimes none of the unloading stations needs a train. Thus, the unload full cargo interrupt won't trigger and thus ignored. Since it is ignored, the game will check the next script. Since the full train also passes the "has cargo" condition, you may also have a full train triggered the condition that are only meant for partially-filled trains, which finally causes the trouble.
TheBuzzSaw
Burner Inserter
Burner Inserter
Posts: 13
Joined: Fri Sep 08, 2023 4:02 pm
Contact:

Re: Train Condition - Cargo Not Full

Post by TheBuzzSaw »

robot256 wrote: Tue Jan 20, 2026 4:39 am Just curious, what were you building?
I was trying to send my train to be topped off if it had anything less than completely full wagons.
robot256 wrote: Tue Jan 20, 2026 4:39 am You want an interrupt to trigger when the train is partially full?
I wanted the interrupt to trigger when the train was partially or completely empty. The issue is that "Has cargo" is true if the cargo is also completely full, and "Empty cargo" is the opposite extreme.
robot256 wrote: Tue Jan 20, 2026 4:39 am Would that not trigger most of the time, i.e. as soon as one item was removed from a full train or one item was added to an empty train?
Sure, but it was never going to work in isolation. I had other conditions that also had to be true such as lacking an open destination. I eventually overcame this by manually checking "iron ore < 4000" (for two wagons), but that killed any chance of making the interrupt reusable for other materials or numbers of cargo wagons.
reduke
Long Handed Inserter
Long Handed Inserter
Posts: 61
Joined: Tue May 22, 2018 5:37 pm
Contact:

Re: Train Condition - Cargo Not Full

Post by reduke »

I fully support this suggestion.

Many times I have wanted my train to leave after inactivity with partially empty cargo - but never to leave if it is inactive and full.
Post Reply

Return to “Ideas and Suggestions”