Page 1 of 1

[Rseding91] [2.0.7] Cannot create LogisticFilter with non-zero value

Posted: Mon Oct 21, 2024 5:44 pm
by sparr
Attempting to create a logistic filter with a non-zero value on a constant combinator control behavior produces an error "Can't specify non zero request with non trivial item filter condition."
  1. build a constant combinator
  2. game.player.selected.get_control_behavior().get_section(1).set_slot(1, {value={type="virtual",name="signal-X"}})
  3. observe first slot of first (only) section has signal X with count 0
  4. game.player.print(game.player.selected.get_control_behavior().get_section(1).get_slot(1).min)
  5. observe min of 0, the count of the signal
  6. manually set signal X count to 1
  7. game.player.print(game.player.selected.get_control_behavior().get_section(1).get_slot(1).min)
  8. observe min of 1, the count of the signal
  9. optionally build a new constant combinator for the next step, this will not affect the outcome
  10. game.player.selected.get_control_behavior().get_section(1).set_slot(1, {value={type="virtual",name="signal-X"},min=1})
  11. observe error
PS: Also note that the signal/filter successfully created has a quality icon on it, which I don't think is appropriate or possible to achieve in this context in the normal UI.

Re: [Rseding91] [2.0.7] Cannot create LogisticFilter with non-zero value

Posted: Mon Oct 21, 2024 6:27 pm
by Rseding91
Thanks for the report. The issue seems to be that the quality condition is defaulting to "any" which is not valid for values in constant combinators. If you add quality="normal" directly after the name="signal-x" it fixes it. That's not a great fix - since quality things are mostly meant to default to the correct values so they can be omitted when the quality prototypes are not being used.

Re: [Rseding91] [2.0.7] Cannot create LogisticFilter with non-zero value

Posted: Sat Nov 02, 2024 4:28 am
by hgschmie
This is also an issue when assigning a signal as output signal e.g. in a decider combinator (`set_output(idx, { signal = ... }`)

Re: [Rseding91] [2.0.7] Cannot create LogisticFilter with non-zero value

Posted: Fri Nov 22, 2024 5:59 am
by hgschmie
While this ended up in "minor issues", it is a pain in the neck to remember to add quality = 'normal' to any signal assigned to a constant combinator in a mod. Lots of older mods break because they never bothered with quality before.

Any change to make LuaLogisticSection::set_slot use "normal" as the default value. The current default ("any") causes the crash ("Can't specify non zero request with non trivial item filter condition."). Honestly, I don't even know what that means. ;-)