Page 1 of 1

LuaRecipePrototype.hidden_from_player_crafting

Posted: Wed Jan 12, 2022 8:42 pm
by detnac
https://lua-api.factorio.com/latest/Lua ... r_crafting
It does not actually work. To hide recipe from handcrafting menu you need to use hide[instead of hidden]_from_player_crafting, but in the documentation only "hidden", which destoyed my mental health just for 20 minutes. Fix it please, I worry about the psyche of my colleagues

Re: Small documentation improvement requests

Posted: Wed Jan 12, 2022 9:34 pm
by Loewchen
detnac wrote: Wed Jan 12, 2022 8:42 pm https://lua-api.factorio.com/latest/Lua ... r_crafting
It does not actually work. To hide recipe from handcrafting menu you need to use hide[instead of hidden]_from_player_crafting, but in the documentation only "hidden", which destoyed my mental health just for 20 minutes. Fix it please, I worry about the psyche of my colleagues
The doc tells already that hidden_from_flow_stats is read only, you are mixing scripting with prototype creation. Check out https://lua-api.factorio.com/latest/Data-Lifecycle.html and https://wiki.factorio.com/Prototype_overview.

Re: LuaRecipePrototype.hidden_from_player_crafting

Posted: Mon Apr 04, 2022 11:18 am
by sdgmlj
How can I hide it?

Re: LuaRecipePrototype.hidden_from_player_crafting

Posted: Mon Apr 04, 2022 11:28 am
by robot256
You must set the recipe to be hidden when the prototype is defined in the Data stage. It cannot be changed at runtime.

https://wiki.factorio.com/Prototype/Recipe

Re: LuaRecipePrototype.hidden_from_player_crafting

Posted: Mon Apr 04, 2022 11:38 am
by sdgmlj
robot256 wrote: Mon Apr 04, 2022 11:28 am You must set the recipe to be hidden when the prototype is defined in the Data stage. It cannot be changed at runtime.

https://wiki.factorio.com/Prototype/Recipe
If I set hidden = true, it will not be displayed in the machine. I just want to hide it from the player, and the machine can choose

Re: LuaRecipePrototype.hidden_from_player_crafting

Posted: Mon Apr 04, 2022 11:44 am
by robot256
The very next line is "hide_from_player_crafting". This is the name in the data stage, when it is writable. In the control stage it becomes "hidden_from_player_crafting", when it is read-only.

https://wiki.factorio.com/Prototype/Rec ... r_crafting

Re: LuaRecipePrototype.hidden_from_player_crafting

Posted: Mon Apr 04, 2022 11:57 am
by sdgmlj
robot256 wrote: Mon Apr 04, 2022 11:44 am The very next line is "hide_from_player_crafting". This is the name in the data stage, when it is writable. In the control stage it becomes "hidden_from_player_crafting", when it is read-only.

https://wiki.factorio.com/Prototype/Rec ... r_crafting
My God, I finally understand

Should be: hidden = false,

hide_ from_ player_ crafting = true,

:D :D :D :D :D :D Thank you, my friend.

Re: LuaRecipePrototype.hidden_from_player_crafting

Posted: Mon Apr 04, 2022 11:58 am
by robot256
You are very welcome!