The major power we gained is to use the red and green wire inputs separately. This enables us to use the EACH wildcard with different wires for its operands. This is used throughout almost all of my examples.
I consider adding this as additional combinator tutorial to the wiki, so I'm interested in feedback and bugfixes for blueprints and descriptions. Or if you have more generic snippets I should add. Or if language can be improved, I'm not native English speaking. I tried to keep everything as generic as possible and not just show how I personally solve the circuit challenges.
It goes from easy to somewhat advanced and specialized.
Contents
- Math/basic arithmetic operations
- Find the minimum/maximum of 2 inputs
- Include only filtered items
- Exclude filtered items
- Limit filtered items
- Generic latch (hysteresis)
- Counter
- Clock
- Memory cell
- Filter real items
- Iterate over a list of signals
- Digital Display
- Stalled belt detector
- Map item to recipe
- Limit train limit
- Asteroid collecting
- Edge detector
- Pulse extender
- Periodic memory snapshot
- Throughput display
Basic combinator setups
One or two combinators with simple functionality.
The descriptions you see are also added as combinator descriptions everywhere in the blueprints.
Math/basic arithmetic operations
Divide everything from red-wire by everything from green-wire.Can be used for all the other arithmetic operations as well. This wiring and wire selection within the combinator is the basic setup how to use the 2 wires independently throughout all the other examples.
Find the minimum/maximum of 2 inputs
For finding the minimum, the first combinator outputs all signals from green wire whose values are lower than or equal to the corresponding signals on red wire.The other combinator outputs all signals from red wire whose values are lower than the corresponding signals on green wire.
The combined output represents the minimum values of both inputs.
The maximum works the same, just the conditions reversed. Minimum:
Maximum:
Include only filtered items
Arbitrary signals on red wire.Filter definition on green wire.
Output only signals from red wire also present on green wire.
Values on green wire don't matter, don't need to be 1.
Exclude filtered items
Arbitrary signals on red wire.Filter definition on green wire.
Output only signals from red wire not present on green wire.
Values on green wire don't matter, don't need to be 1.
Limit filtered items
Filter everything below or above some limit.With red wire limit for some given signals is input.
Output every signal from green wire that's below the limit. Ignore signals from green wire that don't exist in the filter on red wire.
Inverse the condition to > to output every signal above the limit.
Example usage: Use output as filter for an inserter that's moving only items with less than (or more than) the given amount of items in some storage.
Generic latch (hysteresis)
Activate [signal-check] if input signal [iron-ore] raises above the upper limit (200).[signal-check] stays active until input signal [iron-ore] goes below the lower limit (100).
Signal has to raise above 200 again to activate [signal-check] again.
Reversed functionality: Use < and <= as comparison and exchange higher and lower limit, if you need to activate the output if the input is below the lower threshold and keep it activated until the upper limit is reached.
Counter
Counts things, for example items moved by an inserter.It is reset to 0 if [R]>0 is provided.
Clock
This clock counts from 0 to 100, then starts from 0 again.Feel free to provide a different reset condition with different input signals. The clock counts as long as the conditions render true.
In contrast to clocks from game version 1.1, you're able to provide the +1 increment inline as output signal, so an extra constant combinator is usually not needed.
Multi combinator setups
Now to some more complex setups with 2 and more combinators.
Memory cell
Store an arbitrary signal composition.One combinator passes the incoming signals if the set condition is true, the other one passes the output via loopback as long as the set condition is false. Both combined create a memory cell: either the first combinator sends the outgoing signal or the second one.
The given example stores the incoming signal on red while S<>0 on green and holds it as memory while S=0.
Since the incoming signals are passed on a different wire color than the set condition, the set condition is independent from the signals to store. With this example, some other S could be included in the signals to store and will not interfere with the S queried for the set condition.
Filter real items
I don't know how useful this is. By checking if an incoming signal has an associated stack value and filter all that hasn't one, we can drop fluids and virtual signals and keep only signals from real items.(edit 2025-04-15: updated screenshots to include combinator settings)