What is the purpose of a recipe's hidden property?
What is the purpose of a recipe's hidden property?
Subject says it all. It seems to me that setting this property doesn't hide the recipe from the crafting menu, or the research tab for when research unlocks that recipe.
I can't find anywhere that it did appear but then doesn't after it's hidden, if that makes sense. Help!
I can't find anywhere that it did appear but then doesn't after it's hidden, if that makes sense. Help!
- bobingabout
- Smart Inserter
- Posts: 7352
- Joined: Fri May 09, 2014 1:01 pm
- Contact:
Re: What is the purpose of a recipe's hidden property?
An extract from my mod.
This recipe is hidden, it does not show up in the recipe lists when I open my inventory.
Being used on a furnace type building, it is automatically selected, but there's no indication that it is actually a recipe anywhere in the game.
There is actually a base game example of the hidden tag being used. I THINK it's on the rocket silo or something.
Off topic, I love that results line, that's a work around for a recipe that deletes things. The result has to be an item that isn't used in any recipes, with a probability of 0. So I made an item called Void, it looks like some kind of black hole, or vortex.
Code: Select all
{
type = "recipe",
name = "void-oxygen",
category = "void-fluid",
hidden = "true",
energy_required = 1,
ingredients =
{
{type="fluid", name="oxygen", amount=25}
},
results=
{
{type="item", name="void", amount=1, probability=0},
},
subgroup = "void",
icon = "__bobplates__/graphics/icons/void-oxygen.png",
order = "oxygen"
},
Being used on a furnace type building, it is automatically selected, but there's no indication that it is actually a recipe anywhere in the game.
There is actually a base game example of the hidden tag being used. I THINK it's on the rocket silo or something.
Off topic, I love that results line, that's a work around for a recipe that deletes things. The result has to be an item that isn't used in any recipes, with a probability of 0. So I made an item called Void, it looks like some kind of black hole, or vortex.
Re: What is the purpose of a recipe's hidden property?
Does the void item have flags "hidden" as a property? In my limited experience playing around, it's that property which stops the recipe from appearing in your inventory?
Re: What is the purpose of a recipe's hidden property?
It's the rocket-part.bobingabout wrote:An extract from my mod.
<snip>
This recipe is hidden, it does not show up in the recipe lists when I open my inventory.
Being used on a furnace type building, it is automatically selected, but there's no indication that it is actually a recipe anywhere in the game.
There is actually a base game example of the hidden tag being used. I THINK it's on the rocket silo or something.
bobingabout wrote:Off topic, I love that results line, that's a work around for a recipe that deletes things. The result has to be an item that isn't used in any recipes, with a probability of 0. So I made an item called Void, it looks like some kind of black hole, or vortex.
Hmm...DRY411S wrote:Does the void item have flags "hidden" as a property? In my limited experience playing around, it's that property which stops the recipe from appearing in your inventory?
- The vanilla rocket-part has the item.flags "hidden" set and the recipe.hidden = true.
- It doesn't show in the inventory crafting menu.
- It does however display in the crafting menu if recipe.hidden is false whether or not the item.flags array includes "hidden"
- It does not appear if recipe.hidden is true whether or not the item.flags array includes "hidden"
- This suggests that the recipe.hidden property takes the greatest priority over item.flags.
This suggests that my mod is faulty, because I'm trying to hide a vanilla recipe and failing spectacularly.
Example (in recipes.lua, required by data.lua) ....
Code: Select all
data.raw.recipe.battery.hidden = true
Re: What is the purpose of a recipe's hidden property?
Sometimes writing these things down to explain them to other people helps you find the bugs in your own code. And you end up talking to yourself on forums.
So going back to the subject of the topic, the purpose of a recipe's hidden property is to hide the recipe from the crafting menus. This only works if you write code that sets the property correctly. In my case,
should in fact be:
I blame the Wube documentation ....

So going back to the subject of the topic, the purpose of a recipe's hidden property is to hide the recipe from the crafting menus. This only works if you write code that sets the property correctly. In my case,
Code: Select all
data.raw.recipe.battery.hidden = true
Code: Select all
data.raw.recipe.battery.normal.hidden = true
data.raw.recipe.battery.expensive.hidden = true
- Arch666Angel
- Smart Inserter
- Posts: 1636
- Joined: Sun Oct 18, 2015 11:52 am
- Contact:
Re: What is the purpose of a recipe's hidden property?
hidden = true in recipes hides the recipe from the crafting menu ("e") so the recipe is not selectable for crafting by hand or machine, but the recipe can still be selected by autocrafting entities -> smelters, that's how bobs and my void entities work. If a recipe with the tag is included in a tech it is visible in the tech itself, but that wont change the crafting menu behavior.
adding flags = {"hidden"} to an item hides it from the item menu which you can look at from selecting filters in your toolbar for example. I use this to hide items I override and are no longer used.
--- wont error, but I wont go into effect either? I'm experimenting around with the normal/expensive setting myself at the moment and some things are...mystic...
adding flags = {"hidden"} to an item hides it from the item menu which you can look at from selecting filters in your toolbar for example. I use this to hide items I override and are no longer used.
---
Code: Select all
data.raw.recipe.battery.hidden = true
Angels Mods
I. Angel's Mods Subforum
II. Development and Discussion
III. Bugs & FAQ

"should be fixed"
I. Angel's Mods Subforum
II. Development and Discussion
III. Bugs & FAQ

"should be fixed"
Re: What is the purpose of a recipe's hidden property?
I don't think I understand your example. Can you say more please?Arch666Angel wrote:<snip>
adding flags = {"hidden"} to an item hides it from the item menu which you can look at from selecting filters in your toolbar for example. I use this to hide items I override and are no longer used.
<snip>
The documentation says it is removed from all crafting menus. http://lua-api.factorio.com/latest/LuaI ... type.flags However my testing suggests that it isn't hidden unless the recipe.hidden flag is set.
It appears to me that you can only set the hidden flags in data-final-fixes. If I set them in data.lua, they seem to have been reset by the time the game starts.Arch666Angel wrote:<snip>wont error, but I wont go into effect either? I'm experimenting around with the normal/expensive setting myself at the moment and some things are...mystic...Code: Select all
data.raw.recipe.battery.hidden = true
Re: What is the purpose of a recipe's hidden property?
The game does no such thing so if that's happening then some other mod(s) you're using are causing it.DRY411S wrote:It appears to me that you can only set the hidden flags in data-final-fixes. If I set them in data.lua, they seem to have been reset by the time the game starts.
If you want to get ahold of me I'm almost always on Discord.
Re: What is the purpose of a recipe's hidden property?
Mystic like this? viewtopic.php?t=51070Arch666Angel wrote:<snip>wont error, but I wont go into effect either? I'm experimenting around with the normal/expensive setting myself at the moment and some things are...mystic...Code: Select all
data.raw.recipe.battery.hidden = true
- bobingabout
- Smart Inserter
- Posts: 7352
- Joined: Fri May 09, 2014 1:01 pm
- Contact:
Re: What is the purpose of a recipe's hidden property?
My void item is also hidden, yes. But as explained above, that doesn't change the functionality of hiding the recipe.DRY411S wrote:Does the void item have flags "hidden" as a property? In my limited experience playing around, it's that property which stops the recipe from appearing in your inventory?