Recipe with 0 amount of ingredient sometimes don't work

This subforum contains all the issues which we already resolved.
Post Reply
User avatar
<NO_NAME>
Filter Inserter
Filter Inserter
Posts: 291
Joined: Tue Aug 02, 2016 9:52 am
Contact:

Recipe with 0 amount of ingredient sometimes don't work

Post 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
Attachments
PerfectlyGenericObject_1.16.1.zip
The entire mod that contains the invalid recipe. (It's a very small mod.)
(8.2 KiB) Downloaded 145 times
I am a translator. And what did you do for Factorio?
Check out my mod "Realistic Ores" and my other mods!

User avatar
Deadlock989
Smart Inserter
Smart Inserter
Posts: 2528
Joined: Fri Nov 06, 2015 7:41 pm

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

Post by Deadlock989 »

What does including 0 transport belts in a recipe actually mean?
Image

User avatar
5thHorseman
Smart Inserter
Smart Inserter
Posts: 1193
Joined: Fri Jun 10, 2016 11:21 pm
Contact:

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

Post 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 = {}

User avatar
<NO_NAME>
Filter Inserter
Filter Inserter
Posts: 291
Joined: Tue Aug 02, 2016 9:52 am
Contact:

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

Post 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.
Last edited by <NO_NAME> on Tue May 01, 2018 7:32 pm, edited 1 time in total.
I am a translator. And what did you do for Factorio?
Check out my mod "Realistic Ores" and my other mods!

kovarex
Factorio Staff
Factorio Staff
Posts: 8078
Joined: Wed Feb 06, 2013 12:00 am
Contact:

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

Post by kovarex »

So I just made a check with an error when recipe ingredient item count is 0.

User avatar
<NO_NAME>
Filter Inserter
Filter Inserter
Posts: 291
Joined: Tue Aug 02, 2016 9:52 am
Contact:

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

Post 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.
I am a translator. And what did you do for Factorio?
Check out my mod "Realistic Ores" and my other mods!

User avatar
<NO_NAME>
Filter Inserter
Filter Inserter
Posts: 291
Joined: Tue Aug 02, 2016 9:52 am
Contact:

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

Post 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.)
I am a translator. And what did you do for Factorio?
Check out my mod "Realistic Ores" and my other mods!

Post Reply

Return to “Resolved Problems and Bugs”