Page 1 of 1

Consider only inputs from combinator

Posted: Mon Apr 21, 2025 2:36 pm
by BuildItBusk
I want to create a circuit logic (any combinators allowed) which takes a set of items + quantity from a constant combinator and outputs how many of those items I have more than the input in my logistic network.

I can sort of get it to do that, but I struggle to get it to consider only the items from the combinator. In other words, all items I don't specify, it will simply assume that I want zero of those. Can I get it to ignore any items which isn't specified in the constant combinator?

Example
I specify:
- 200 green prints
- 600 steel

I have:
- 300 green prints
- 750 steel
- 240 red prints

Output should be:
- 100 green prints
- 150 steel

(I didn't specify any quantity for red prints, so that must not be part of the output.

Re: Consider only inputs from combinator

Posted: Mon Apr 21, 2025 4:47 pm
by jdrexler75
You can make a filter with a constant combinator on a separate wire (red vs. green), and a decider.

In a nutshell: Put the constant combinator on (e.g.) the red input wire. Put everything else on the green input wire. Set condition "each(red) > 0", and output the input value from green to get the filtered signals.

Depending on what you do with the result, if you don't mind getting the negative difference, you can do all this with a single decider instead. Just set the constant value negative and output the sum with the condition flipped: "each(red) < 0". Like if you want to enable/disable something you can set its condition to enabled if the signal is negative.


Re: Consider only inputs from combinator

Posted: Mon Apr 21, 2025 6:33 pm
by BuildItBusk
Thanks, that seems to work. For a start I wanted to use it to trash excess items on Fulgora. But I feel I can also use it to control requests to a planet based on the content of the logistic network and not just the Cargo Landing Pad.

Re: Consider only inputs from combinator

Posted: Mon Apr 21, 2025 9:41 pm
by jdrexler75
Yeah it's useful in just about every situation, I must have hundreds of these circuits everywhere.

Another variant is to set inserter filters, with the conditions like "each(red) > 0" "and" "each(green) less than each(red)", and output a value of 1 for each.