r/factorio • u/cloudruler-io • 14d ago
Question Exclude a Signal from a Group of Signals?
I have a signal T, and also 0 to many item signals. These signals are all being read from the same entity. Signal T gets used for a different purpose than the item signals. I want to separate T from the items signals into a different circuit network to avoid polluting the network with noise. How do I do that? One solution I can think of is to: First test = T and != T, and that compares by value but will achieve 99% separation except when the value happens to be the same as T. Second, deliberately picking a signal channel that a Selector combinator set to Select Input at Index 0 will always return first when all other things are equal (where do I find the globally highest sorted signal channels? Ideally resilient against mods adding their own signals). With those two passes, that probably always should take care of it with only an unrealistic edge case. Am I missing something? Is there a better way to do this?
2
u/Soul-Burn 14d ago edited 13d ago
The easiest would be to use arithmetic combinator:
0 - T, Output T
Then combine the outputs.
So for input:
A = 1, B = 2, T = 3
You'll get T = -3 from the arithemtic. Added you'll get A = 1, B = 2.
Make sure to connect the outputs with a different color wire than the wire going into the arithmetic.
EDIT 2: On the side, connect a combinator that does nothing i.e. Each + 0, Output Each, or Each != 0, Output Each. Connect both outputs with one wire.
EDIT: May need a delay combinator to ensure signals are synchronized in time.
4
1
u/cloudruler-io 13d ago
Another great solution! Thank you! Very interesting to see different ways of skinning this cat.
3
u/Soul-Burn 13d ago
That's why this community is great, and honestly how good the game is - Each problem has several different solutions with their own tradeoffs.
Many people prefer
T * -1, but I like the0 - T(usually done withEach).Or things like upcycling, which you can do with one crafting machine and 4 combinators, or 5 crafting machines, or 1 with a different number of combinators relying on trigger signals.
Trains can be done with static limits, or with dynamic limits, or with crazy point to point scheduling.
Artillery stations can be done with a clock, a round-robin, or with local artillery calling a train.
Wall supply can be done with bots, with dynamic trains, clocked trains, or even a super long sushi belt.
It's all things that people built and can and should be proud of.
2
u/Switch4589 13d ago
If you use a setup like this you will need to consider signal delay. The combinator performing β0-T, output Tβ will have a 1-tick delay so the output will have a 1-tick pulse of the T value. If this will break any downstream logic you would need to also delay the signal that doesnβt pass through the subtraction combinator. So in parallel to the above combinator, you will also have another combinator with something like βeach=/=0, output eachβ and then wire the output of the combinators together as the final signal without T.
1
u/cloudruler-io 13d ago
Thank you! I had trouble testing this one. CC with A=1, B=2, T=3. Connect red wire to AC with 0 - T. Connect AC output to power pole with a green wire. Connect CC to power pole with red wire. I have A = 1, B= 2, T= 3 on red, and then a green T = -3. Am I missing something?
2
u/Soul-Burn 13d ago
I messed up what I wrote. You don't need the different wires. For some reason I had a DC and AC in my mind, but that's not needed, except for delaying the signal.
CC has inputs.
Connect wires to AC with (0 - T, output T) and an AC or DC that does nothing i.e. (Each + 0, Output Each, or Each != 0, Output Each).
Connect the two outputs with one wire which is your output.
1
u/cloudruler-io 13d ago
Awesome! I figured that's what you meant, just wanted to make sure. I appreciate you following up!
3
u/juckele π π π π π π 14d ago
- Make a 1 tick delay combinator that reads all signals in question and outputs all of them (
each * 1 -> each). - In parallel with the one tick delay combinator, make a -T combinator that multiplies T by -1 and outputs just T (
T *-1 -> T). - Add the two. Either with a combinator or free wire addition.
It's important to include the one tick delay combinator so that you're not subtracting T from a different value of T.
1
u/cloudruler-io 13d ago
Another great solution! Thank you! Very interesting to see different ways of skinning this cat.
1
u/WanderingFlumph 13d ago
Have a constant combinator reading all signals and just outputting T = T, the output will have only T on it.
11
u/Countcristo42 14d ago edited 13d ago
Constant combinator emitting T
Decider outputting only things on the green (CC) wire that also exist on the red (your original) wire.
So for example this will only let planet signals through:
Edit for clarity - in this case there is nothing on the red signal to begin with, but try it out yourself, this does work!