Page 1 of 1

[0.15.34] stuck recipe when results[i].amount > stack_size

Posted: Wed Sep 20, 2017 9:59 am
by Optera
While writing a mod to give settings for stack sizes for various items I noticed some broken fix with recipe.results.
If recipe result amount > item.stack_size factorio correctly splits the result into multiple results by itself which is great, but it doesn't update the amount of each result resulting in a machine getting stuck after the first recipe is completed.

Example:

Code: Select all

recipe.results = 
{
 { type = "item", name = stone, amount = 100 }
}
will result in

Code: Select all

recipe.results = 
{
 { type = "item", name = stone, amount = 100 },
 { type = "item", name = stone, amount = 100 }
}
Edit:
The confusing part about this is the recipe in game will show 2x 50 stacks of stone even if stone has a stack size of e.g. 60.

Re: [0.15.34] stuck recipe when results amount > item.stack_size

Posted: Wed Sep 20, 2017 10:30 am
by Bilka
Duplicate: 51625

Re: [0.15.34] stuck recipe when results amount > item.stack_size

Posted: Wed Sep 20, 2017 6:22 pm
by Optera
Bilka wrote:Duplicate: 51625
Your link is about recipe.result_count > item.stack_size. I'm already handling that.

This report is about factorio generating additional results when results.amount > item.stack_size without setting results.amount to stack_size or lower.

Re: [0.15.34] stuck recipe when results[i].amount > stack_size

Posted: Thu Sep 21, 2017 2:24 pm
by Rseding91
I don't understand what you're saying but it seems to work correctly in 0.16: the recipe produces 100 stone and it goes into the single output slot of the assembling machine as a single stack of 100.

Re: [0.15.34] stuck recipe when results[i].amount > stack_size

Posted: Thu Sep 21, 2017 7:39 pm
by Optera
What i perceived as automatically splitting results in stacks was actually an undesired effect of another mod in my dev setup.
Removing the interfering mod makes a recipe using recipe.resultsamount consistently get stuck exactly like recipe.result_count. Knowing there is no faulty fix for this in place made adding the fix in my mod easy.