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>
Fast Inserter
Fast Inserter
Posts: 243
Joined: Tue Aug 02, 2016 9:52 am
Contact:

Recipe with 0 amount of ingredient sometimes don't work

Post by <NO_NAME> » Tue May 01, 2018 4:40 pm

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

User avatar
Deadlock989
Filter Inserter
Filter Inserter
Posts: 987
Joined: Fri Nov 06, 2015 7:41 pm
Contact:

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

Post by Deadlock989 » Tue May 01, 2018 5:10 pm

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

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

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

Post by 5thHorseman » Tue May 01, 2018 5:34 pm

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 = {}
"So you completed the game with a spaghetti factory? Well I hand crafted a rocket and threw it into space with my bare hands!"

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

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

Post by <NO_NAME> » Tue May 01, 2018 5:59 pm

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 you did for Factorio?
Check out my mod "Realistic Ores" and my other mods!

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

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

Post by kovarex » Tue May 01, 2018 6:25 pm

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

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

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

Post by <NO_NAME> » Tue May 01, 2018 7:33 pm

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 you did for Factorio?
Check out my mod "Realistic Ores" and my other mods!

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

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

Post by <NO_NAME> » Thu May 03, 2018 12:42 am

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 you did for Factorio?
Check out my mod "Realistic Ores" and my other mods!

Post Reply

Return to “Resolved Problems and Bugs”

Who is online

Users browsing this forum: No registered users