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".