Page 1 of 1

Recipe with 0 amount of ingredient sometimes don't work

Posted: Tue May 01, 2018 4:40 pm
by <NO_NAME>
I was screwing around with mods to figure out something and I found a peculiar problem.

This recipe don't work correctly:
Here is the code
Factorio says "Not enough ingredients" even if I have both "transport-belt" and "perfectly-generic-object" in my inventory.

The recipe works correctly if I change amount of transport belts to 1.
It also works with 0 amount of ingredient in different configuration:
Different configuration

Re: Recipe with 0 amount of ingredient sometimes don't work

Posted: Tue May 01, 2018 5:10 pm
by Deadlock989
What does including 0 transport belts in a recipe actually mean?

Re: Recipe with 0 amount of ingredient sometimes don't work

Posted: Tue May 01, 2018 5:34 pm
by 5thHorseman
Yeah it seems that transport belt line is totally not needed in your recipe.

Here's the entire code block from my "Free Circuit Wires" mod.

Code: Select all

data.raw["recipe"]["red-wire"].ingredients = {} 
data.raw["recipe"]["green-wire"].ingredients = {}

Re: Recipe with 0 amount of ingredient sometimes don't work

Posted: Tue May 01, 2018 5:59 pm
by <NO_NAME>
Deadlock989 wrote:What does including 0 transport belts in a recipe actually mean?
It doesn't mean anything. I've been testing something else and I found this by accident.
Handling of 0 amount by the game is inconsistent so it qualifies as a bug.

Re: Recipe with 0 amount of ingredient sometimes don't work

Posted: Tue May 01, 2018 6:25 pm
by kovarex
So I just made a check with an error when recipe ingredient item count is 0.

Re: Recipe with 0 amount of ingredient sometimes don't work

Posted: Tue May 01, 2018 7:33 pm
by <NO_NAME>
kovarex wrote:So I just made a check with an error when recipe ingredient item count is 0.
After the next update I will report if everything work correctly.

Re: Recipe with 0 amount of ingredient sometimes don't work

Posted: Thu May 03, 2018 12:42 am
by <NO_NAME>
Looks like it works.
(Well recipes with 0 amount of an ingredient probably still don't work but you definitely can't define one now.)