New condition, slots full

Post your ideas and suggestions how to improve the game.

Moderator: ickputzdirwech

torvawk
Burner Inserter
Burner Inserter
Posts: 6
Joined: Fri Jun 29, 2018 9:10 pm
Contact:

New condition, slots full

Post by torvawk »

I was trying to set up a Trash Train system and I was running into issues. I got around most of them but one. The not quite full problem. Yes, I can use has cargo. But that just mean Not empty. And with a trash system, you may never get to a full condition either. What I am looking for is a mostly full condition. But with varying stack sizes and unknown contents, I can't just do a simple item count with a constant. So, my suggestion is quite simple.

Along with the empty, has cargo, and full conditions, I want a "slots full" condition. Meaning, if all the stacks on the wagons have at least something in them with no slot empty, then trip the condition. At least this is the only way I can see that you can have a "mostly full" condition.

I don't care if all the stacks are maxed out. I do care if I can add something new or not. I want to get my trash trains as full as I can before sending them home.
torvawk
Burner Inserter
Burner Inserter
Posts: 6
Joined: Fri Jun 29, 2018 9:10 pm
Contact:

Re: New condition, slots full

Post by torvawk »

I could even work with a slot count. AKA the number of slots occupied.
bluss
Burner Inserter
Burner Inserter
Posts: 8
Joined: Wed Nov 06, 2024 5:26 pm
Contact:

Re: New condition, slots full

Post by bluss »

It depends on the situation, but in some cases you can just use the inactivity for this. Meaning: inserters can't insert more into the train, so it goes inactive, and you know it's ok to go/leave.
User avatar
Khazul
Fast Inserter
Fast Inserter
Posts: 200
Joined: Fri Sep 03, 2021 4:47 am
Contact:

Re: New condition, slots full

Post by Khazul »

Read contents of train.
Get stack sizes of everything in the train (selector combinator)
Divide contents of train by stack sizes (used to derive number of full slots)
Modulo contents of train by stack size and then divide result by itself to yield 1s if any signal is non-zero (used to derive number of partially filled slots)
Sum these two multi-signal values into a single signal - N for eg.

You may need to add some insert delays (each * 1 => each for eg) to avoid any multipath signal glitching while signals propagate through the resulting circuit if that matters to you for your intended use.

N is number of slots used assuming contents of a wagon are stacked (cant remember offhand if non-packed slots can happen other than by manual intervention, for eg several slots of the same thing with only a few in each rather than all being fully stacked except one with a few items).

Also slot filter reservations in a wagon will break assumption of 40-N yielding number of free slots (40 being total number of slots in a wagon unless modded to something else).

It will be easier and likely just as useful to have an inactivity timeout on the train.
Post Reply

Return to “Ideas and Suggestions”