Page 1 of 1

[2.0.60] Incorrect handling of Selector combinator parameters table

Posted: Fri Jul 18, 2025 7:04 pm
by robot256
SelectorCombinatorParameters states that quality_source_static can be specified as type QualityID, which can be either LuaQualityPrototype or the string name of a quality prototype. However, both read and write of quality_source_static are done with a table in the form {name=<quality name>}. This behavior is inconsistent with how other quality specifications are treated, so I believe the behavior should be changed to match the documentation.

Reproduction:

1. Paste the following blueprint, which is a selector combinator configured to transfer "rare" quality onto "epic U-238".

2. Move the cursor over the selector combinator and run the following console command.

Code: Select all

/c game.print(serpent.block(game.player.selected.get_control_behavior().parameters))
3. Observe the output:

Code: Select all

{
  operation = "quality-transfer",
  quality_destination_signal = {
    name = "uranium-238",
    quality = "epic"
  },
  quality_source_static = {
    name = "rare"
  }
}
4. Keep the cursor in place and run the following console command:

Code: Select all

/c local a=game.player.selected.get_control_behavior().parameters; a.quality_source_static="legendary"; game.player.selected.get_control_behavior().parameters=a
5. Observe that the quality_source_static parameter has been reset to "normal" because it did not read the value in the parameters given.
6. Run the final console command:

Code: Select all

/c local a=game.player.selected.get_control_behavior().parameters; a.quality_source_static={name="legendary"}; game.player.selected.get_control_behavior().parameters=a
7. Observe that the quality_source_static parameter has now changed to "legendary".

Re: [2.0.60] Incorrect handling of Selector combinator parameters table

Posted: Thu Aug 14, 2025 5:29 pm
by Rseding91
Thanks for the report. The way the parameters are saved/loaded are done through saving/loading a property tree. The only format that supports are tables and values - things such as lua prototypes aren't supported and so it won't ever work with them.

In this case the lua docs will need to be changed to reflect this.

Re: [2.0.60] Incorrect handling of Selector combinator parameters table

Posted: Fri Aug 15, 2025 12:28 am
by robot256
Rseding91 wrote: Thu Aug 14, 2025 5:29 pm Thanks for the report. The way the parameters are saved/loaded are done through saving/loading a property tree. The only format that supports are tables and values - things such as lua prototypes aren't supported and so it won't ever work with them.

In this case the lua docs will need to be changed to reflect this.
That works too, thanks! That means it will stay the same and I won't need to change my "workaround" code.

Re: [2.0.60] Incorrect handling of Selector combinator parameters table

Posted: Mon Aug 18, 2025 2:36 pm
by Bilka
Docs fixed for 2.0.65.