[0.15.34] Combinator set_signal cryptic error messages and docs

Things that has been reported already before.
Post Reply
User avatar
Adil
Filter Inserter
Filter Inserter
Posts: 945
Joined: Fri Aug 15, 2014 8:36 pm
Contact:

[0.15.34] Combinator set_signal cryptic error messages and docs

Post 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?
I do mods. Modding wiki is friend, it teaches how to mod. Api docs is friend too...
I also update mods, some of them even work.
Recently I did a mod tutorial.

Rseding91
Factorio Staff
Factorio Staff
Posts: 13209
Joined: Wed Jun 11, 2014 5:23 am
Contact:

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

Post 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
If you want to get ahold of me I'm almost always on Discord.

Post Reply

Return to “Duplicates”