LuaRecipePrototype.hidden_from_player_crafting

Place to get help with not working mods / modding interface.
detnac
Manual Inserter
Manual Inserter
Posts: 1
Joined: Wed Jan 12, 2022 8:33 pm
Contact:

LuaRecipePrototype.hidden_from_player_crafting

Post 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
Loewchen
Global Moderator
Global Moderator
Posts: 10262
Joined: Wed Jan 07, 2015 5:53 pm
Contact:

Re: Small documentation improvement requests

Post 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.
sdgmlj
Fast Inserter
Fast Inserter
Posts: 174
Joined: Sun Jul 04, 2021 11:12 pm
Contact:

Re: LuaRecipePrototype.hidden_from_player_crafting

Post by sdgmlj »

How can I hide it?
robot256
Smart Inserter
Smart Inserter
Posts: 1248
Joined: Sun Mar 17, 2019 1:52 am
Contact:

Re: LuaRecipePrototype.hidden_from_player_crafting

Post 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
My mods: Multiple Unit Train Control, RGB Pipes, Shipping Containers, Rocket Log, Smart Artillery Wagons.
Maintainer of Auto Deconstruct, Cargo Ships, Vehicle Wagon, Honk, Shortwave.
sdgmlj
Fast Inserter
Fast Inserter
Posts: 174
Joined: Sun Jul 04, 2021 11:12 pm
Contact:

Re: LuaRecipePrototype.hidden_from_player_crafting

Post 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
robot256
Smart Inserter
Smart Inserter
Posts: 1248
Joined: Sun Mar 17, 2019 1:52 am
Contact:

Re: LuaRecipePrototype.hidden_from_player_crafting

Post 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
My mods: Multiple Unit Train Control, RGB Pipes, Shipping Containers, Rocket Log, Smart Artillery Wagons.
Maintainer of Auto Deconstruct, Cargo Ships, Vehicle Wagon, Honk, Shortwave.
sdgmlj
Fast Inserter
Fast Inserter
Posts: 174
Joined: Sun Jul 04, 2021 11:12 pm
Contact:

Re: LuaRecipePrototype.hidden_from_player_crafting

Post 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.
robot256
Smart Inserter
Smart Inserter
Posts: 1248
Joined: Sun Mar 17, 2019 1:52 am
Contact:

Re: LuaRecipePrototype.hidden_from_player_crafting

Post by robot256 »

You are very welcome!
My mods: Multiple Unit Train Control, RGB Pipes, Shipping Containers, Rocket Log, Smart Artillery Wagons.
Maintainer of Auto Deconstruct, Cargo Ships, Vehicle Wagon, Honk, Shortwave.
Post Reply

Return to “Modding help”