Hi engineers, I'm asking for some help about an "issue" I have encountered while making a bot mall.
Here is a first look of the mall :
As you can see, each assembling machine got its own light indicator that tells if the product have enough stock or not by light turning red or green. I'm using the only "if : else :" system I know to do with combinators here, to explain briefly, two comparators look at the value showed by the storage chest and one send a red signal if the storage is below a certain number, the other send "green" signal if the storage is equal or above the same number. Lights are parametrized as showing corresponding colours and always on.
The issue I got then is that theses two decider combinators for EACH assembling machine ends up taking a lot of space (just for a little light indicator system that I wanna have in the mall yes), so I'm asking if some better informatic engineers could help me figure out a solution to avoid using such a number of decider combinators (while keep having a indicator system).
I thought about something but couldn't figure out the rest of the solution : for example items that must be capped at 100, we could have two decider combinators that receive every storage chest signals in entry (yellow asterisk) and then compare every value to 100, and output a certain signal ? I couldn't think about the next part tho...
Thanks you for reading this unwell written post and even more if you can help me !
need help for a Mega Mall feature.
Re: need help for a Mega Mall feature.
The simplest thing you can do to reduce it to just *one* combinator each is to have a single constant combinator outputting "green=1", connected to all of the lamps (using whichever color of wire you aren't using to connect each lamp to its decider), and then only have the decider that outputs red when the stock is too low. If lamps receive multiple color signals they take priority in the order they are listed in the signal choosing UI, so the lamps will all light up green "by default" from the constant combinator, but when they are also receiving a red signal from their decider this will override it and make the lamp red.
There are several other ways to arrange this that also use one combinator per lamp that have other advantages (like using a constant combinator to define how many of each item you want altogether and wiring that throughout the system so that you don't have to set the per-item limits separately in the lamp logic and also in the inserter logic) but I think the one above is the simplest change to what you currently have.
I can't think of a way to switch between two different colors without using at least one combinator per lamp but maybe someone else has a cleverer trick?
There are several other ways to arrange this that also use one combinator per lamp that have other advantages (like using a constant combinator to define how many of each item you want altogether and wiring that throughout the system so that you don't have to set the per-item limits separately in the lamp logic and also in the inserter logic) but I think the one above is the simplest change to what you currently have.
I can't think of a way to switch between two different colors without using at least one combinator per lamp but maybe someone else has a cleverer trick?
Re: need help for a Mega Mall feature.
You could red-wire your lamp directly to the chest, and set it to light on only if the contents are below the threshold
You would lose the red/green indicator, and only retain a lamp on / lamp off information, but that would require no combinators at all
Even better, you could connect the lamp directly to the logistic network (there's a small button in the top-right of the GUI), so that it reads the number of available items (yellow splitters in the example of your screenshot) in the whole base, instead of only that chest.
J'ai remarqué que tes screenshots sont en français, donc je te mets aussi ma réponse en langue natale :
Tu peux connecter directement la lampe au coffre avec un fil rouge (ou vert), et lui dire de s'allumer si le contenu du coffre est en dessous d'un seuil.
Les lampes s'allumeront uniquement quand il manque un produit, plutôt que de s'éclairer en rouge et vert, mais cette solution n'implique aucun combinateur
Encore mieux, tu peux connecter la lampe au réseau logistique plutôt qu'au coffre, et ainsi elle prendra en compte l'ensemble des items de cette catégorie éparpillés dans tous les coffres jaunes de la base, plutôt que seulement ceux dans ce coffre du mall !
You would lose the red/green indicator, and only retain a lamp on / lamp off information, but that would require no combinators at all
Even better, you could connect the lamp directly to the logistic network (there's a small button in the top-right of the GUI), so that it reads the number of available items (yellow splitters in the example of your screenshot) in the whole base, instead of only that chest.
J'ai remarqué que tes screenshots sont en français, donc je te mets aussi ma réponse en langue natale :
Tu peux connecter directement la lampe au coffre avec un fil rouge (ou vert), et lui dire de s'allumer si le contenu du coffre est en dessous d'un seuil.
Les lampes s'allumeront uniquement quand il manque un produit, plutôt que de s'éclairer en rouge et vert, mais cette solution n'implique aucun combinateur
Encore mieux, tu peux connecter la lampe au réseau logistique plutôt qu'au coffre, et ainsi elle prendra en compte l'ensemble des items de cette catégorie éparpillés dans tous les coffres jaunes de la base, plutôt que seulement ceux dans ce coffre du mall !
Re: need help for a Mega Mall feature.
You could try something like this:
Lamps use packedRGB colours, each lamp is responding to one signal, based on what item it is meant to indicate about.
Constant combinators next to them simulate chests (for demonstration and easy debugging purposes).
Lamps are wired together with one shared green wire, combinators/storage one shared red wire.
These go to the central processing on the left.
Item amounts are normalized to 1, then multiplied by colour numbers.
Based on the item amount one of the colours is sent back.
Notes:
Can be easily extended to support more colours for more detailed level indication (e.g. red for amounts < 10, yellow for between 10 and 50, brown for between 50 and 100, green above 100).
Supports only global limits (i.e. all items above 100 are green, cannot have an exception for e.g. walls being green only if above 200).
If the amount of an item is exactly zero, the colour is black, not red.
Lamps use packedRGB colours, each lamp is responding to one signal, based on what item it is meant to indicate about.
Constant combinators next to them simulate chests (for demonstration and easy debugging purposes).
Lamps are wired together with one shared green wire, combinators/storage one shared red wire.
These go to the central processing on the left.
Item amounts are normalized to 1, then multiplied by colour numbers.
Based on the item amount one of the colours is sent back.
Notes:
Can be easily extended to support more colours for more detailed level indication (e.g. red for amounts < 10, yellow for between 10 and 50, brown for between 50 and 100, green above 100).
Supports only global limits (i.e. all items above 100 are green, cannot have an exception for e.g. walls being green only if above 200).
If the amount of an item is exactly zero, the colour is black, not red.
Re: need help for a Mega Mall feature.
Thank you for your replies @torne and @Karsaell
for Torne : constant combinator is a really clever idea yeah, one decider only should at least help some more to compact things up even more so I take it (plus constant combinator is I believe a track to figure out something even better
for Karsaell : It's a solution I knew before doing my "if else" circuits, problem is that lamp have only on and off information, which yes it still obviously works (plus we can set base colour in it) but isn't the proper system I would like for the mall, but I guess it's a backup solution if I have to compact the mall.
Et merci d'avoir mis en version française, je sais pas si tu es français aussi mais ça reste un geste attentionné !
for Torne : constant combinator is a really clever idea yeah, one decider only should at least help some more to compact things up even more so I take it (plus constant combinator is I believe a track to figure out something even better
for Karsaell : It's a solution I knew before doing my "if else" circuits, problem is that lamp have only on and off information, which yes it still obviously works (plus we can set base colour in it) but isn't the proper system I would like for the mall, but I guess it's a backup solution if I have to compact the mall.
Et merci d'avoir mis en version française, je sais pas si tu es français aussi mais ça reste un geste attentionné !
Re: need help for a Mega Mall feature.
Waw thank you really much @Muche, it'll just take me some time to figure out how packedRGB works and how to parametrize this but it seems really really clever !
Re: need help for a Mega Mall feature.
Ah yes, if you have the same limit for all items then Muche's method of outputting an RGB color value per-item using "each" and then having the lamp pick up its color from the appropriate item signal works. I haven't used this since it was added so forgot it existed now.
You can make this work for *not* having the same limit for all items too, I think (though haven't tried as I'm not in front of the game right now): get the total amount of everything in storage onto the red wire and the desired amount of everything (from a constant combinator) onto the green wire, and feed both wires into two deciders.
One decider does "each (red wire) >= each (green wire)" with output "each=1": this outputs all items that have enough in stock. Feed this into an arithmetic combinator that does "each * RGB value for green = each" to turn all the 1's into the right color value.
The other decider does the opposite: "each (red wire) < each (green wire)" and also outputs "each=1" to list the items that *don't* have enough in stock; multiply that by the RGB value for red instead. Connect the two arithmetic outputs together and wire it to every lamp like in Muche's method with each lamp configured to take its color from the appropriate item signal.
You can make this work for *not* having the same limit for all items too, I think (though haven't tried as I'm not in front of the game right now): get the total amount of everything in storage onto the red wire and the desired amount of everything (from a constant combinator) onto the green wire, and feed both wires into two deciders.
One decider does "each (red wire) >= each (green wire)" with output "each=1": this outputs all items that have enough in stock. Feed this into an arithmetic combinator that does "each * RGB value for green = each" to turn all the 1's into the right color value.
The other decider does the opposite: "each (red wire) < each (green wire)" and also outputs "each=1" to list the items that *don't* have enough in stock; multiply that by the RGB value for red instead. Connect the two arithmetic outputs together and wire it to every lamp like in Muche's method with each lamp configured to take its color from the appropriate item signal.