Describe order of ItemProductPrototype quality operations

Place to report issues and suggest improvements to the API documentation.
User avatar
PennyJim
Fast Inserter
Fast Inserter
Posts: 174
Joined: Wed Jan 18, 2023 3:49 am
Contact:

Describe order of ItemProductPrototype quality operations

Post by PennyJim »

In what order the quality change and quality roll apply affect the odds of the quality being output.

When I asked the discord, the conversation said that as of 2.1.8 it's
  1. get recipe quality
  2. apply quality_change
  3. apply quality_min/quality_max
  4. if affected_by_quality, apply quality effect
  5. if affected_by_quality, apply quality_min/quality_max
  6. resulting quality is product quality

I propose we add a note to quality_min and quality_max to mention it.
I am not tied to those locations specifically, but I personally feel it makes the most sense.

Something like
When processing a recipe, the clamping applies after the quality was affected by `quality_change`, then after it was rolled if `affected_by_quality` is true.
The wording might be improvable, but I like that it also implicitly mentions that quality change applies before the quality roll.
Post Reply

Return to “Documentation Improvement Requests”