Code: Select all
-- in data.lua
data.raw.recipe["submachine-gun"].hidden = true -- hide the submachine gun from the crafting menus
data.raw["gun"]["submachine-gun"].flags = { "hidden" } -- hide the submachine gun item from filter menus (e.g., requester chests)
data.raw.technology["military"].hidden = true -- hide the military technology
Code: Select all
-- in data.lua
data.raw.recipe["submachine-gun"].hidden = true
data.raw.recipe["tank"].hidden = true
data.raw.recipe["cannon-shell"].hidden = true
data.raw.recipe["explosive-cannon-shell"].hidden = true
Code: Select all
-- in game console
/c game.print(game.player.force.recipes["submachine-gun"].prototype.hidden) -- prints false
Code: Select all
-- in data.lua
data.raw.recipe["pistol"].hidden = true
Code: Select all
-- in game console
/c game.print(game.player.force.recipes["pistol"].prototype.hidden) -- prints true
I could be doing something wrong, but it seems to work for all the other recipes. Just those 4 recipes (that I have found so far at least) don't seem to hide correctly. Setting the hidden flag to the item itself works - so the items don't show up in filters, but the recipes stills show up in the crafting menus.
This is in Factorio v0.18.32.
Any ideas? Thanks!