I need to compare types, not amounts.
E.g. 1st constant combinators sends Oil = 1, 2nd sends Gas = 1, result should be 0
E.g. 1st constant combinators sends Gas = 1, 2nd sends Gas = 1, result should be 1
I need this to be able to set signal type in a one place of blueprint so I don't need to change things multiple times after placement so I have less mistakes.
Curcuits: how to compare two unknown signal types?
Re: Curcuits: how to compare two unknown signal types?
Can the second one send -1 instead? Then you can add the signals. A nonzero signal means different types, no signal means equal types.
Re: Curcuits: how to compare two unknown signal types?
Multiply signal 2 by -1. If it matches the signals will cancel out, otherwise they won't.
Re: Curcuits: how to compare two unknown signal types?
Ok, what if one of them is set manually but another can be in any amounts, e.g. 1 Oil and 5 Oil , 1 Oil and 100 Gas?
Re: Curcuits: how to compare two unknown signal types?
You can change any number to 1 with a decider combinator. Each > 1 → Each = 1
Re: Curcuits: how to compare two unknown signal types?
Yes, exactly. As comparison you can utilize for example: everything = 0 --> output 1. If they cancel out this will output 1 otherwise it will output 0.
Re: Curcuits: how to compare two unknown signal types?
Can GAS be = 2?
Otherwise I would use binary.
1 Oil
2 Gas
3 Lube
So you only need one signal, it can contain a really high number of different binary values.
You check if any is active you do:
Signal AND 2 returns 0 if gas isn't active, 1 if active.
Otherwise I would use binary.
1 Oil
2 Gas
3 Lube
So you only need one signal, it can contain a really high number of different binary values.
You check if any is active you do:
Signal AND 2 returns 0 if gas isn't active, 1 if active.