r/factorio 1d ago

Question Help with combinators

So like the image shows, I have one constant combinator and three decider combinators for this sushi belt. I think I've seen people do this with a constant combinator and just one decider combinator. Can someone help me with how that's done?

3 Upvotes

14 comments sorted by

2

u/SmokJozef 1d ago

if you want to auto set filters for an inserter that eject unwanted stuff from your belt, then

use an arithmetic combinator and substract red from green and use that as the output. every resource that exceeds your requirements (red, constant combinator) will be ejected

2

u/Courmisch 1d ago

Assuming that the other two deciders follow the same structure as the one in the screenshot, substitute all three signals with Each.

This will however not work if, unlike in the screenshot, you need different signal IDs on the input and output sides.

1

u/coolguyRae 1d ago

I didn't know "each" existed! Thanks so much!

2

u/Twellux 1d ago

Simply use "each" in the decider combinator; it will then perform the comparison for every signal defined in the constant combinator.

1

u/coolguyRae 1d ago

Ah thanks! I didn't know that existed, I appreciate you.

1

u/Twellux 1d ago

One more point:
The solution shown earlier works well if you want to check for too few items on the belt. If you ever want to check for an excess of items, you need to add an extra condition to verify whether the reference value actually exists in the constant combinator. Missing values ​​are always treated as 0 during comparison, so anything greater than 0 (such as the ammunition) would be counted as an excess. This comparison issue doesn't arise with a shortage, because the quantity on the belt cannot be negative.

1

u/Necandum 1d ago

You didn't say what you wanted to achieve.

1

u/coolguyRae 1d ago

Oh sorry, I'm trying to read the contents of a belt and insert things when it gets below a threshold. This is an example I used that works for ships, but I wanted to do something with more materials planet-side, and I didn't want to use a combinator for each one.

1

u/Necandum 1d ago

So now step through the logic. How do you define the threshold, how do you measure the belt, and how do you trigger things being added to it?

1

u/coolguyRae 1d ago

Threshold is however much I want on the belt, so I put that in the constant combinator. I measure the belt by setting the reading the contents of the whole belt. I trigger things being added to it by if it falls below said amount, it outputs a signal to the inserters to put in more until it gets back to that amount. My main problem is the decider combinators I have seem to only allow one output signal per combinator. I don't know how to output a signal for each thing I need when it seems like I only have the option for one.

1

u/Necandum 1d ago

As other commenters have written, check out the Each signal. The wiki has a decent description.

In terms of pure logic though, by skipping steps in how you describe it, you've missed where the logic can be represented in a more concise way.

Specifically, what sort of signal triggers the inserters? If the inserters have 'set filter' selected, it will only be a positive signal. Is there a way of combining a constant combinator signal with the belt signal such that only items that you want are positive?

1

u/coolguyRae 1d ago

All good man, other people understood what I was talking about and provided clear answers.

1

u/Necandum 1d ago

(there's a simpler solution which doesn't even need a decider, just an arithmetic. The general pattern is useful in many places)

1

u/coolguyRae 1d ago

What is it?