Page 1 of 1

[0.17.35] Extra "parameters" level in LuaArithmeticCombinatorControlBehavior

Posted: Fri May 03, 2019 1:24 am
by ignatio
The parameters for an arithmetic combinator resides in LuaArithmeticCombinatorControlBehavior.parameters.parameters. From https://lua-api.factorio.com/latest/Lua ... vior.brief I expected one level of "parameters".

To reproduce: Place an arithmetic combinator, set its first signal to "A", and select it.
/c game.player.print(game.player.selected.get_control_behavior().parameters.first_signal.name)
Cannot execute command: ... attempt to index field 'first_signal' (a nil value)
/c game.player.print(game.player.selected.get_control_behavior().parameters.parameters.first_signal.name)
signal-A

Re: [0.17.35] Extra "parameters" level in LuaArithmeticCombinatorControlBehavior

Posted: Mon May 06, 2019 9:37 pm
by Rseding91
Thanks for the report. All of the combinator control behavior interfaces work like this. It was a mistake when I made the API but changing it right now would serve no purpose except to break every mod out there using them (again).

I'll make a note of it, and if we decide to push some other large breaking change I'll add this into the mix. Until then, you just have to add an extra .parameters to the calls.