Recipes with zero quantities

Bugs that are actually features.
User avatar
Ranakastrasz
Smart Inserter
Smart Inserter
Posts: 2179
Joined: Thu Jun 12, 2014 3:05 am
Contact:

Recipes with zero quantities

Post by Ranakastrasz »

I accidently made a recipe which used zero plastic. Mainly because I assumed that the game when loading would ignore that piece of the code.

Instead, it shows up, as requiring zero plastic. However, while it shows up as white if you hover over the recipe in the assembler, it won't run unless you have at least one piece of plastic, which is never consumed.

This probably qualifies as a bug, but you could use this mechanic to add catalysts, or molds, or similar if you wanted.
My Mods:
Modular Armor Revamp - V16
Large Chests - V16
Agent Orange - V16
Flare - V16
Easy Refineries - V16
User avatar
Klonan
Factorio Staff
Factorio Staff
Posts: 5415
Joined: Sun Jan 11, 2015 2:09 pm
Contact:

Re: Recipes with zero quantities

Post by Klonan »

If you make a recipe say, 0 plastics and 10 iron plate to make something, and you put this in an assembler, will the 1 plastic you input be 'used up' by the assembler, or will it remain in the ingredient slot?

This could be VERY useful as a catalyst, or something.
reddutton
Long Handed Inserter
Long Handed Inserter
Posts: 53
Joined: Sun Jul 19, 2015 12:35 am
Contact:

Re: Recipes with zero quantities

Post by reddutton »

it may be a bug but as you said it can be usefull for the modding comunity to make it to where you have to have as set tool to make a certain item would be interesting thought if that tool could have a durability like the science pack and be consumed over time
thy may be stupid but thy am smart (reddutton 2006 seconlife)
kovarex
Factorio Staff
Factorio Staff
Posts: 8298
Joined: Wed Feb 06, 2013 12:00 am
Contact:

Re: Recipes with zero quantities

Post by kovarex »

Well, this behaviour seems to be fine.
User avatar
Aprillion
Inserter
Inserter
Posts: 34
Joined: Sun Apr 16, 2017 10:43 am
Contact:

Re: Recipes with zero quantities

Post by Aprillion »

There are catalysts in recipes now, e.g. "kovarex-enrichment-process" recipe in 0.16.7 contains 2 catalysts: uranium-235 and uranium-238, but the same items are also ingredients, so no idea how that works (didn't get that far into game yet ¯\_(ツ)_/¯).

Catalysts are not explained on https://wiki.factorio.com/Kovarex_enrichment_process

edit: but I found viewtopic.php?t=51654 which was the problem that seems to be solved with the current concept of "catalysts".

Any interaction of the 0 amount ingredient feature with the new catalysts feature?

P.S.: Console command for exploring the catalysts - which seem to be an array of {"item" :: LuaItemPrototype, "amount" :: uint} (different from http://lua-api.factorio.com/latest/Conc ... Ingredient):

Code: Select all

/c
local recipe = game.player.force.recipes['kovarex-enrichment-process']
for i, ingredient in ipairs(recipe.ingredients) do
  for k, v in pairs(ingredient) do
    game.print('ingredient' .. i .. ' ' .. k .. ': ' .. tostring(v))
  end
end
for i, catalyst in ipairs(recipe.catalysts) do
  for k, v in pairs(catalyst) do
    if type(v) == "table" and v.help then
      v = '{name: ' .. v.name .. '} :: ' .. v.help():gsub('Help for ', ''):gsub(':.*', '')
    end
    game.print('catalyst' .. i .. ' ' .. k .. ': ' .. tostring(v))
  end
end
Post Reply

Return to “Not a bug”