Place down a constant combinator anywhere, and run the following command to see the problem in action:
Code: Select all
/c local behavior = game.player.selected.get_control_behavior()
behavior.set_signal(1, {signal={name="signal-everything",type="virtual"}, count=1})
behavior.set_signal(2, {signal={name="signal-anything", type="virtual"}, count=1})
behavior.set_signal(3, {signal={name="signal-each", type="virtual"}, count=1})
This surprisingly doesn't result in any weird behavior - the signals are simply treated like any others, and don't mess with any conditions.
The GUI is also slightly broken, since it only updates the preview of the constant combinator, but not the signals itself after the command is run. Only after closing and reopening it again, the set signals appear and until then, it looks like this:
Decider combinators have a similar lack of guard against these signals: they seem to do a consistency check for the left input & the output signal, but the second signal doesn't. Place a decider combinator and run the following command:
Code: Select all
/c game.player.selected.get_control_behavior().parameters = {parameters={second_signal = {type="virtual",name="signal-anything"}} }
Secondly, here is the result of that command:
I tried a few things, and it seems to simply interpret it like any other signal, but it's at best very misleading to allow this state to exist.
The GUI doesn't update here properly either
Lastly, the same command also works on arithmetic combinators, and (when setting each) allows us to at least try to achieve some sought after states
I was hopeful for 0.3s that this would actually do a parallel multiply, but it instead treats the right each like a normal signal, i.e. feeding in [Each = 2, A=3] results in [Each = 4, A = 6] and feeding in [A = 1, B=-2] results in no output (since everything got multiplied by 0)
So to summarize, there are three kind of related bugs here (sorry that I didn't post them separately!):
1. Combinators don't guard against logic signals when set via lua
2. LuaDeciderCombinatorControlBehavior and LuaArithmeticCombinatorControlBehavior have parameters.parameters as subfield, not just parameter
3. Combinators don't update their GUI immediately when modified by lua