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.
Consider only inputs from combinator
-
- Manual Inserter
- Posts: 2
- Joined: Mon Apr 21, 2025 2:29 pm
- Contact:
-
- Fast Inserter
- Posts: 112
- Joined: Sat Nov 28, 2020 5:27 pm
- Contact:
Re: Consider only inputs from combinator
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.
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.
-
- Manual Inserter
- Posts: 2
- Joined: Mon Apr 21, 2025 2:29 pm
- Contact:
Re: Consider only inputs from combinator
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.
-
- Fast Inserter
- Posts: 112
- Joined: Sat Nov 28, 2020 5:27 pm
- Contact:
Re: Consider only inputs from combinator
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.
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.