Page 1 of 1

How do I use control signals to set stack size on an inserter?

Posted: Mon Jun 29, 2020 8:58 pm
by Calion
I can find nothing on this, anywhere. The tutorials don’t mention it, the wiki only says that you can do it. What I’m specifically wanting to do at the moment is change the stack size based on the quantity of items in a box.

Thanks!

Re: How do I use control signals to set stack size on an inserter?

Posted: Mon Jun 29, 2020 10:20 pm
by Impatient
Hi!
  • You check the checkbox Set stack size
  • You select a signal. The value of that signal will be the stack size. If the value is higher than the max stack size, the stack size will be the max stack size.
  • Somewhere you assign a value to this signal
Does that clarify the mechanic?

Re: How do I use control signals to set stack size on an inserter?

Posted: Tue Jun 30, 2020 6:28 pm
by Calion
Where do you assign the value to the signal?

Re: How do I use control signals to set stack size on an inserter?

Posted: Tue Jun 30, 2020 7:28 pm
by Serenity
That depends on what you want exactly. You want to read the number of items in a box. So you need to do something with that

Re: How do I use control signals to set stack size on an inserter?

Posted: Tue Jun 30, 2020 9:51 pm
by MEOWMI
The signal is "assigned" a value by computing the signal from the chest: addition, subtraction, division, booleans, etc.

Cable goes from chest to arithmetic (or decider) combinator, possibly a chain of several depending on how you want to compute the chest content signal. Might include changing one signal into another, so you'll have to think what calculations will turn the chest content signal into your desired number from 1 to 3 or 1 to 12. Then after all that, feed the output into your inserter. Done.

Example:
  1. Chest to Decider A: Is the For Each signal less than 50? If so output 1.
  2. Chest to Decider B: Is the For Each signal less than 25? If so output 1.
  3. Constant combinator C: always output 1.
  4. Decider A, B and Constant combinator C all to Inserter: Use the signal for setting stack size. (Connect all the output wires to it. Make sure using all of the same signal. We're using the fact that signals from multiple outputs are always implicitly added together to give a value of 1-3 depending on amount if items in chest.)
N.B.: There may exist more optimized setups even for my example calculation.

And if you're still unsure how to start, you can begin by just connecting a constant combinator to something and playing with that. Then you can slowly add the other devices and slowly build a feel for how they work. Experiment! After some time, the instructions will make sense! If you need to double check your results at any point, hook your device up to a power pole as that will let you read off the resulting signal!

Re: How do I use control signals to set stack size on an inserter?

Posted: Tue Jun 30, 2020 11:38 pm
by Impatient
Calion wrote:
Tue Jun 30, 2020 6:28 pm
Where do you assign the value to the signal?
Now that is a different question. If you want to know how the circuit network works, start here:
https://wiki.factorio.com/Circuit_network

Re: How do I use control signals to set stack size on an inserter?

Posted: Wed Jul 01, 2020 7:01 pm
by astroshak
Calion wrote:
Mon Jun 29, 2020 8:58 pm
I can find nothing on this, anywhere. The tutorials don’t mention it, the wiki only says that you can do it. What I’m specifically wanting to do at the moment is change the stack size based on the quantity of items in a box.

Thanks!
Are you looking to reduce inserter grab amount as the box’ contents go up, or are you looking to increase the inserter grab amounts as the box’ contents go up?

Wire the box to whatever Combinators are needed to do your math. Then wire the output of that to the Inserter. Check the ‘Set Stack Size’ option. If the resulting signal sent to the Inserter is greater than 3 or 11 (Inserter or Stack Inserter) It will functionally be reduced to 3 or 11. If it is less, then the stack size will reflect the lower amount. If the number is 0, there won’t be any signal sent. If it is less than zero.... I’ve had issues with it being less than zero before.