[0.17.44] Lamp light color does not consider condition signal color
Posted: Fri May 31, 2019 12:22 am
I expected that light color depends on all signals matching condition specified in the lamp settings.
It actually uses probably highest color index of any positive signal if condition is met instead of considering only signals matching condition. In other words, it should behave like that only if signal with asterix (any/all) was used.
It's simple to reproduce. Just send two color signals with positive value to the lamp and light it up if the one with lower index is positive.
Eg. Sending blue 1 and yellow 1. Lamp should light up when yellow is present. Instead blue is visible despite this lamp should not react on blue. It would be more convenient and also more flexible if in case of condition expecting color lamp would consider only this color.
I know you have covered case in which you provide color and control signals separately via separate networks. In this case it will be expected behavior as you provide color signal explicitly. In this case if you expect control signal to be a color, it would be nice to have exception from this rule.
- If you want the lamp to have different color than signal controlling it, then base condition on anything but color.
- If you want the lamp to have color of control signal, then you don't have to do anything.
Example scenario.
Create control board which sends different signals with colors to run different pumps. Now you place lamp at each factory block with the same condition as pump fueling it. In solution I propose here it would light up factory block with color that is condition to run it. No matter that the same network controls all other pumps with different signals.
In current implementation you'd have to create one network with non color signals for controls and several separated networks with constant combinators to send color signal to each sector. Otherwise they will still light up with higher color index present in common network.
There is no drawback in this solution as using color signal as both control and color is inconsistent. If you want to light the lamp only when yellow signal is positive, then sometimes you will have yellow light (of all other signals have lesser priority) and sometimes you will have different color. In proposed solution you would always have the same color as the one that should trigger this light or current behavior if condition is based only on non color signals.
You are aware of this mechanism so maybe it should become feature request (I found more information after creating this report).
Simply said, if condition contains explicit color signal, use this one. Otherwise use current order of any input signal color.
It actually uses probably highest color index of any positive signal if condition is met instead of considering only signals matching condition. In other words, it should behave like that only if signal with asterix (any/all) was used.
It's simple to reproduce. Just send two color signals with positive value to the lamp and light it up if the one with lower index is positive.
Eg. Sending blue 1 and yellow 1. Lamp should light up when yellow is present. Instead blue is visible despite this lamp should not react on blue. It would be more convenient and also more flexible if in case of condition expecting color lamp would consider only this color.
I know you have covered case in which you provide color and control signals separately via separate networks. In this case it will be expected behavior as you provide color signal explicitly. In this case if you expect control signal to be a color, it would be nice to have exception from this rule.
- If you want the lamp to have different color than signal controlling it, then base condition on anything but color.
- If you want the lamp to have color of control signal, then you don't have to do anything.
Example scenario.
Create control board which sends different signals with colors to run different pumps. Now you place lamp at each factory block with the same condition as pump fueling it. In solution I propose here it would light up factory block with color that is condition to run it. No matter that the same network controls all other pumps with different signals.
In current implementation you'd have to create one network with non color signals for controls and several separated networks with constant combinators to send color signal to each sector. Otherwise they will still light up with higher color index present in common network.
There is no drawback in this solution as using color signal as both control and color is inconsistent. If you want to light the lamp only when yellow signal is positive, then sometimes you will have yellow light (of all other signals have lesser priority) and sometimes you will have different color. In proposed solution you would always have the same color as the one that should trigger this light or current behavior if condition is based only on non color signals.
You are aware of this mechanism so maybe it should become feature request (I found more information after creating this report).
Simply said, if condition contains explicit color signal, use this one. Otherwise use current order of any input signal color.