Page 1 of 1

[0.15.34] Combinator set_signal cryptic error messages and docs

Posted: Tue Sep 19, 2017 6:01 pm
by Adil
From docs it would seem, that the `set_signal` method of the constant combinator control behavior takes two arguments:
LuaConstantCombinatorControlBehavior

Control behavior for constant combinators.

set_signal(index, ConstantCombiantorSignal)
Sets the signal at the given index

Parameters
index :: uint
However, when called with two arguments, it complains that the argument #3 is nil, if called with three arguments, it says "wrong number of arguments".
code
Also, the definition of ConstantCombiantorSignal seems to contain index already, why is it requested as separate argument?

Re: [0.15.34] Combinator set_signal cryptic error messages and docs

Posted: Tue Sep 19, 2017 6:15 pm
by Rseding91
Thanks for the report. In this case the docs are wrong - param 2 is just a Signal - which is already fixed for 0.16:

Code: Select all

/c global.b.set_signal(1, {signal={type="item", name="iron-plate"}, count=5})
You're giving "signal_id" which also isn't valid - it's just "signal" as the docs show here: http://lua-api.factorio.com/latest/Conc ... ntorSignal