[0.17.35] Extra "parameters" level in LuaArithmeticCombinatorControlBehavior

This subforum contains all the issues which we already resolved.
Post Reply
ignatio
Long Handed Inserter
Long Handed Inserter
Posts: 86
Joined: Mon Jun 27, 2016 3:59 pm
Contact:

[0.17.35] Extra "parameters" level in LuaArithmeticCombinatorControlBehavior

Post 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

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

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

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

Post Reply

Return to “Resolved Problems and Bugs”