Solved: Disabling/modifiying recipes

Place to get help with not working mods / modding interface.
Post Reply
User avatar
quadrapod
Inserter
Inserter
Posts: 36
Joined: Tue Jan 21, 2014 12:54 am
Contact:

Solved: Disabling/modifiying recipes

Post by quadrapod »

How can I go about disabling or changing recipes.

For example when I try and use something like.

Code: Select all

data.raw.recipe["piercing-shotgun-shell"].ingredients =
    {
      {"copper-plate", 10},
      {"steel-plate", 5},
      {"coal", 4}
    }
I see no change.
Last edited by quadrapod on Fri Jan 24, 2014 10:58 pm, edited 1 time in total.

User avatar
FreeER
Smart Inserter
Smart Inserter
Posts: 1266
Joined: Mon Feb 18, 2013 4:26 am
Contact:

Re: Disabling/modifiying recipes

Post by FreeER »

That should work. The problem might be if you are loading a previously started game rather than starting a new one, in that case you have to tell Factorio to reload the recipes (either using the in-game console or a control.lua or a migration) with

Code: Select all

game.player.force.resetrecipes() --reloads all recipes
or

Code: Select all

game.player.force.recipes["piercing-shotgun-shell"].reload() --reloads specific recipe
<I'm really not active any more so these may not be up to date>
~FreeER=Factorio Modding
- Factorio Wiki
- My Factorio Modding Guide
- Wiki Modding Guide
Feel free to pm me :)
Or drop into #factorio on irc.esper.net

User avatar
quadrapod
Inserter
Inserter
Posts: 36
Joined: Tue Jan 21, 2014 12:54 am
Contact:

Re: Disabling/modifiying recipes

Post by quadrapod »

FreeER wrote:That should work. The problem might be if you are loading a previously started game rather than starting a new one, in that case you have to tell Factorio to reload the recipes (either using the in-game console or a control.lua or a migration) with

Code: Select all

game.player.force.resetrecipes() --reloads all recipes
or

Code: Select all

game.player.force.recipes["piercing-shotgun-shell"].reload() --reloads specific recipe

Ah, yeah that's it. Thank you.

Post Reply

Return to “Modding help”