Changing recipe of base-mod item

Place to get help with not working mods / modding interface.
Rapio
Burner Inserter
Burner Inserter
Posts: 9
Joined: Sat Feb 16, 2013 8:57 am
Contact:

Changing recipe of base-mod item

Post 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.
ficolas
Smart Inserter
Smart Inserter
Posts: 1068
Joined: Sun Feb 24, 2013 10:24 am
Contact:

Re: Changing recipe of base-mod item

Post by ficolas »

it is possible, but im not sure how, I think that it is modifying data.raw.recipes.thenameoftherecipe
slpwnd
Factorio Staff
Factorio Staff
Posts: 1835
Joined: Sun Feb 03, 2013 2:51 pm
Contact:

Re: Changing recipe of base-mod item

Post 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"].
User avatar
zer0t3ch
Fast Inserter
Fast Inserter
Posts: 118
Joined: Fri Jul 26, 2013 6:06 am
Contact:

Re: Changing recipe of base-mod item

Post 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!
"F**k thy hater"
-George Watsky

Feel free to contact me!
Skype: Zer0t3ch
Razer Comms: Zer0t3ch
Email: zer0t3ch@live.com

Image
Post Reply

Return to “Modding help”