[0.16.39][Modding] Disabling recipe electric-mining-drill

Bugs that are actually features.
Post Reply
User avatar
lovely_santa
Filter Inserter
Filter Inserter
Posts: 502
Joined: Sat Feb 18, 2017 9:41 pm
Contact:

[0.16.39][Modding] Disabling recipe electric-mining-drill

Post by lovely_santa »

Hi,

I'm trying to disable the electric mining drill recipe in the prototyping stage by:

Code: Select all

data.raw["recipe"]["electric-mining-drill"].enabled = false
When entering a (new) game, even with only this line of code in a blanco mod, it will still show the recipe in the crafting menu.

Greetings,
lovely_santa
You can find all my mods on the mod portal. Also helping on Arch666Angel's mods.
Image

User avatar
Deadlock989
Smart Inserter
Smart Inserter
Posts: 2528
Joined: Fri Nov 06, 2015 7:41 pm

Re: [0.16.39][Modding] Disabling recipe electric-mining-drill

Post by Deadlock989 »

Had similar issues and asked here for help in the past, enabled is part of the difficulty settings for some reason, so if expensive and normal are defined, you have to check those. So annoying, but not a bug.

Code: Select all

-- thanks to Bilka
local function disable_recipe(recipe)
   if not data.raw.recipe[recipe] then return end
   if data.raw.recipe[recipe].normal then
      data.raw.recipe[recipe].normal.enabled = false
      data.raw.recipe[recipe].expensive.enabled = false
   else
      data.raw.recipe[recipe].enabled = false
   end
end
Image

Bilka
Factorio Staff
Factorio Staff
Posts: 3140
Joined: Sat Aug 13, 2016 9:20 am
Contact:

Re: [0.16.39][Modding] Disabling recipe electric-mining-drill

Post by Bilka »

To prevent further confusion in the future: Everything in the recipe data section here is part of normal/expensive property if those exist: https://wiki.factorio.com/Prototype/Recipe
I'm an admin over at https://wiki.factorio.com. Feel free to contact me if there's anything wrong (or right) with it.

User avatar
lovely_santa
Filter Inserter
Filter Inserter
Posts: 502
Joined: Sat Feb 18, 2017 9:41 pm
Contact:

Re: [0.16.39][Modding] Disabling recipe electric-mining-drill

Post by lovely_santa »

Time to mine that data out of the wiki, thanks bilka
You can find all my mods on the mod portal. Also helping on Arch666Angel's mods.
Image

Post Reply

Return to “Not a bug”