Help with storage chest comparison please!

Don't know how to use a machine? Looking for efficient setups? Stuck in a mission?
Trollvano
Manual Inserter
Manual Inserter
Posts: 3
Joined: Wed Dec 18, 2024 11:20 pm
Contact:

Help with storage chest comparison please!

Post by Trollvano »

I'm currently trying to figure out how to set assemblers to only build an item if the contents on the storage network of 2 items total equal together, is less than a certain amount.
PXL_20241218_230311624.jpg
PXL_20241218_230311624.jpg (4.16 MiB) Viewed 631 times
I have assemblers set to if the value is over 0, then disable.
PXL_20241218_230311624.jpg
PXL_20241218_230311624.jpg (4.16 MiB) Viewed 631 times
So I have this setup, and I KNOW it's wrong and not working at all. But can't figure out for the life of me how to do this. Any help would be greatly greatly appreciated .

Not sure if I need to use decider or arithmetic, but basically, I want the assemblers to turn on and make additional barrels, if the TOTAL number of empty AND crude oil filled barrels is < 3 million. I could only figure out having the separate values of < 3 of each, but once the regular barrels go to curde it will be under 3m and try to make more barrels. Which I don't want. I don't want to over exceed my storage but I want to maintain close to full.
Attachments
PXL_20241218_230246955.jpg
PXL_20241218_230246955.jpg (3.62 MiB) Viewed 631 times
Loewchen
Global Moderator
Global Moderator
Posts: 10258
Joined: Wed Jan 07, 2015 5:53 pm
Contact:

Re: Help with storage chest comparison please!

Post by Loewchen »

The individual comparison is a dead end, if one is 1G and the other is 0 you still do not want to produce more.
What you want to do is add both values, there are several ways to do this, most straight forward is adding them in an arithmetic combinator and outputting the sum on a signal of your choice. Then you can simply set the condition in the assembler for what ever output signal you decided on to be <3M.
Trollvano
Manual Inserter
Manual Inserter
Posts: 3
Joined: Wed Dec 18, 2024 11:20 pm
Contact:

Re: Help with storage chest comparison please!

Post by Trollvano »

There helpful thank you!

So I got it done by

Network storage went into those 2 arithmetics via red.
Item1 * 1 -- output to whatever signal (X)
Item2 * 1 -- output to same signal

Both go into a decider view red aswell.
X < 3,000,000 -- output X 1

That goes into the assembler via red wires
Enable/disable = X > 0

Send to be working. Though I would pay the solution incase it helps anyone because I'm a simpleton and it took me way to long even with Loewchens help. Thank you again Loewchens!
Tertius
Smart Inserter
Smart Inserter
Posts: 1346
Joined: Fri Mar 19, 2021 5:58 pm
Contact:

Re: Help with storage chest comparison please!

Post by Tertius »

Trollvano wrote: Thu Dec 19, 2024 4:26 am Network storage went into those 2 arithmetics via red.
Item1 * 1 -- output to whatever signal (X)
Item2 * 1 -- output to same signal
You're able to do this with just 1 arithmetic combinator, since you can simply add both values directly. You don't need to cast them to a common signal before adding them

And now you have the sum in N, so you can use N in the activation condition of the assembler directly. You don't need the intermediate decider. Just wire the output of the arithmetic combinator with the assembler and use N < 3.000.000 as activation condition in the assembler instead of red cross > 0.
12-19-2024, 11-21-41.png
12-19-2024, 11-21-41.png (167.24 KiB) Viewed 535 times
Last edited by Tertius on Thu Dec 19, 2024 10:26 am, edited 2 times in total.
Trollvano
Manual Inserter
Manual Inserter
Posts: 3
Joined: Wed Dec 18, 2024 11:20 pm
Contact:

Re: Help with storage chest comparison please!

Post by Trollvano »

That must be what he was talking about, but I couldn't figure out how. This is actually incredibly easy lol thank you guys for the help!
Tertius
Smart Inserter
Smart Inserter
Posts: 1346
Joined: Fri Mar 19, 2021 5:58 pm
Contact:

Re: Help with storage chest comparison please!

Post by Tertius »

Also see my edit to also get rid of the decider. [that's also what Loewchen was talking about]
Post Reply

Return to “Gameplay Help”