Page 1 of 1

Solved: Disabling/modifiying recipes

Posted: Fri Jan 24, 2014 10:16 pm
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.

Re: Disabling/modifiying recipes

Posted: Fri Jan 24, 2014 10:51 pm
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

Re: Disabling/modifiying recipes

Posted: Fri Jan 24, 2014 10:58 pm
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.