Control Hub - HELP !!!

Don't know how to use a machine? Looking for efficient setups? Stuck in a mission?
Post Reply
milnel
Manual Inserter
Manual Inserter
Posts: 2
Joined: Tue Nov 08, 2016 2:51 am
Contact:

Control Hub - HELP !!!

Post by milnel »

Morning/Afternoon everyone,

I am trying to build a main hub where I can control the number of items inputted into the logistics network using the circuit network. For example, I would set a constant combinator to output 100 Iron and use the circuit network to an inserter inputting into a logistics chest, to only input if iron is less than 100. This part I have done, but that is the easy bit.

I would like to use this same circuit network condition to control all items I produce/input into the network. The problem is how to name the variables to avoid confusion and is there a way for an inserter to check if the item they are holding meets a condition and if so input into a logistics chest.

I have only done basics with the combinators and the ciruit network and thought I would ask the forum for their thoughts.

Further from this idea, how would you build a progress bar that automatically adjust based on the conditions from the constant combinator and turns on a light at 10%, 20%....100%.

I hope the above made sense, as soon as I figure this out with everyones help I will edit this post the reflect the answer or post in the creations part of the forums for everyone to use.

Thanks in advance, love this game, losing many hours on it, but so worth it.

Cheers

User avatar
Deadly-Bagel
Smart Inserter
Smart Inserter
Posts: 1498
Joined: Wed Jul 13, 2016 10:12 am
Contact:

Re: Control Hub - HELP !!!

Post by Deadly-Bagel »

Well you're basically going to want to limit the production in some manner. The simplest way is to connect every inserter inputting to active provider chests to the circuit network along with a roboport. I would do the logic ([Item] < 0) which represents a stock and demand situation. The roboport outputs the contents of the network, and when you want something you multiply it by -1 to represent the demand.

Then to manage the demand, you have your constant combinator. Let's say you have 5 laser towers in the network. Silly number, way too low, so you put 100 on the laser tower signal in your constant combinator. This is passed to an Arithmetic Combinator doing ([Each] * -1 output [Each]) with the output being combined with the roboport and passed to the inserters mentioned above.

What happens is while there are 5 laser towers but no demand, the inserters see a signal of 5 laser towers which does not meet the condition ([laser tower] < 0) so they don't put more in to the network. When you put in your demand for 100, the inserter then receives a signal of -95 laser towers which IS less than 0 so starts working. As more towers are added, the number will eventually reach 0 and your demand is fulfilled. This is tidy because you can link everything in to the same network and not have to worry about signal conflictions. I would probably also have a constant combinator for each tab in the crafting menu to keep things organised.

As for your lights, well that's a different story. Do you want them to work for particular items or everything? And if everything, does that include ALL items in the network or just the ones you are requesting?
Money might be the root of all evil, but ignorance is the heart.

User avatar
ssilk
Global Moderator
Global Moderator
Posts: 12888
Joined: Tue Apr 16, 2013 10:35 pm
Contact:

Re: Control Hub - HELP !!!

Post by ssilk »

Moved from General to Gameplay Help
Cool suggestion: Eatable MOUSE-pointers.
Have you used the Advanced Search today?
Need help, question? FAQ - Wiki - Forum help
I still like small signatures...

milnel
Manual Inserter
Manual Inserter
Posts: 2
Joined: Tue Nov 08, 2016 2:51 am
Contact:

Re: Control Hub - HELP !!!

Post by milnel »

Deadly-Bagel wrote:Well you're basically going to want to limit the production in some manner. The simplest way is to connect every inserter inputting to active provider chests to the circuit network along with a roboport. I would do the logic ([Item] < 0) which represents a stock and demand situation. The roboport outputs the contents of the network, and when you want something you multiply it by -1 to represent the demand.

Then to manage the demand, you have your constant combinator. Let's say you have 5 laser towers in the network. Silly number, way too low, so you put 100 on the laser tower signal in your constant combinator. This is passed to an Arithmetic Combinator doing ([Each] * -1 output [Each]) with the output being combined with the roboport and passed to the inserters mentioned above.

What happens is while there are 5 laser towers but no demand, the inserters see a signal of 5 laser towers which does not meet the condition ([laser tower] < 0) so they don't put more in to the network. When you put in your demand for 100, the inserter then receives a signal of -95 laser towers which IS less than 0 so starts working. As more towers are added, the number will eventually reach 0 and your demand is fulfilled. This is tidy because you can link everything in to the same network and not have to worry about signal conflictions. I would probably also have a constant combinator for each tab in the crafting menu to keep things organised.

As for your lights, well that's a different story. Do you want them to work for particular items or everything? And if everything, does that include ALL items in the network or just the ones you are requesting?
You sir are a legend, this is exactly what I was looking for. Thanks heaps for sending this through.

Regarding the lights, each set of lights (progress bar) would indicate one item. Mainly want to use it for main resource, iron, copper, steel and circuits but would want to be able to adjust to include everything. The only way I can think to do this, would be to pass each signal from a roboport into a Arthimetic Combiator and test if the signal greater than 0.2*,0.4*,0.6*,0.8* of the signal from the Constant Combinator. Each Arthimetic Combinator outputs the same signal and each light counts how many of that signal is being output. So the condition on the lights is ['A' > 1], ['A' > 2} etc for each light. Any thoughts would be much appreciated

User avatar
Deadly-Bagel
Smart Inserter
Smart Inserter
Posts: 1498
Joined: Wed Jul 13, 2016 10:12 am
Contact:

Re: Control Hub - HELP !!!

Post by Deadly-Bagel »

Oh then that's easy. For each set of lights, you'll need just two Arithmetic Combinators and 10 lights (assuming you want increments of 10%, can add more lights as you wish).

First an Arithmetic Combinator takes the raw signal from a roboport (can be the same roboport as above but must use a different colour wire so it doesn't get the demand signal) and multiplies the desired item by 100, output a different signal (for example [Laser Tower] * 100 output [P]). This is fed into another Arithmetic Combinator which also takes the signals directly from your Constant Combinators (before the * -1 so it is getting a positive number) and says ([P] / [Laser Tower] output [P]). This outputs a percentage of how supply is meeting demand on the [P] signal.

Then it's a very simple matter of chain linking it to all your lights and configuring them appropriately ([P] > 9), ([P] > 19), etc.

It's relatively easy this way to swap a set of lights to another item, just modify the two Arithmetic Combinators and you're done, which also makes it easy to blueprint and whack down a bunch of setups.
Money might be the root of all evil, but ignorance is the heart.

nobodx
Fast Inserter
Fast Inserter
Posts: 157
Joined: Mon Jul 06, 2015 3:22 pm
Contact:

Re: Control Hub - HELP !!!

Post by nobodx »

I did a Progress-bar this way:

Constant Combinator to Arithmetic Combinator
- Max Itemnumber / number of Lights =>Temporary Signal (eg 0 )
Temporary Signal to Multiple Arithmetic Combinators (Number of Lights-1)
- Temporary Signal * 2 => Same Temporary Signal (eg 0 ) -- for 2nd Light,
- Temporary Signal * 3 => Same Temporary Signal -- for 3rd Light (and so on)
One Wire color from Each Arithmetic Combinator to the appropiate (?) Light
Wire from Chest to all the lights in the other Color
- All Lights Compare Item > Temporary Signal

The Signal is Dynamic, meaning it works for (almost) any amounts you want (there areome issues, when you want less Items than the amount of lamps)
Attachments
20161110010909_1.jpg
20161110010909_1.jpg (1.92 MiB) Viewed 3038 times

User avatar
Deadly-Bagel
Smart Inserter
Smart Inserter
Posts: 1498
Joined: Wed Jul 13, 2016 10:12 am
Contact:

Re: Control Hub - HELP !!!

Post by Deadly-Bagel »

I don't see any advantage over my suggestion. It uses more combinators (that increase linearly as number of lights go up), more wiring, it's less stable, and if you want to change it to a different item it's a tedious process.

My solution handles the 'less demand than lights' easily as it multiplies then divides, you're dividing then multiplying so you'll run into rounding problems and be less accurate.
Money might be the root of all evil, but ignorance is the heart.

Post Reply

Return to “Gameplay Help”