Page 1 of 1

Changing recipe of base-mod item

Posted: Wed Aug 21, 2013 2:22 pm
by Rapio
Is it possible to change the recipe of a base-mod item with another mod? Like changing the amount of iron-ore needed for iron-plates without copying the whole base-mod.

Re: Changing recipe of base-mod item

Posted: Wed Aug 21, 2013 5:36 pm
by ficolas
it is possible, but im not sure how, I think that it is modifying data.raw.recipes.thenameoftherecipe

Re: Changing recipe of base-mod item

Posted: Sat Aug 24, 2013 7:35 am
by slpwnd
Exactly if your mod depends on another mod (here the base) then it's data definitions are processed afterwards. That means that at the time of processing your mod data definition the other one (base) has already filled everything. So you can simply change the datat it created. For instance if you decide that you need some wood for the basic transport belt:

Code: Select all

local recipe = data.raw.recipe["basic-transport-belt"]
recipe.ingredients[#recipe.ingredients + 1] =  {"wood", 1}
The pattern here is: data.raw.["type-of-the-object"]["name-of-the-object"].

Re: Changing recipe of base-mod item

Posted: Sun Aug 25, 2013 12:15 pm
by zer0t3ch
slpwnd wrote:Exactly if your mod depends on another mod (here the base) then it's data definitions are processed afterwards. That means that at the time of processing your mod data definition the other one (base) has already filled everything. So you can simply change the datat it created. For instance if you decide that you need some wood for the basic transport belt:

Code: Select all

local recipe = data.raw.recipe["basic-transport-belt"]
recipe.ingredients[#recipe.ingredients + 1] =  {"wood", 1}
The pattern here is: data.raw.["type-of-the-object"]["name-of-the-object"].
slpwnd always comes to the rescue!