Hi, I'm very new to modding and I'm trying to make a simple mod that makes wooden chests more difficult to make. However i've run into a problem. I want to change the recipe of the chest to instead of consisting of 2 wood be that of multiple nails and wooden planks. I figured everything out except how to change the vanilla recipe of a wooden chest.
If I made any mistakes please correct me, english is not my first language.
changing vanilla recipes
-
- Manual Inserter
- Posts: 2
- Joined: Mon Nov 04, 2019 9:29 pm
- Contact:
Re: changing vanilla recipes
Code: Select all
data.raw["recipe"]["wooden-chest"].ingredients = {
{"wooden-plank", 6},
{"nail", 12},
}
Re: changing vanilla recipes
Take part of code from vanilla prototypes and place it into your mod folder into the data.lua.
You are need to define items: "nail", "wooden-plank" and icons for them.
After adding items you are need to add recipes for nails and planks, only then changing the recipe of wooden boxes.
See items and recipes here, but don't change they here:
Factorio\data\base\prototypes\item\demo-item.lua
Factorio\data\base\prototypes\item\item.lua
Factorio\data\base\prototypes\recipe\demo-recipe.lua
Factorio\data\base\prototypes\recipe\recipe.lua
You are need to define items: "nail", "wooden-plank" and icons for them.
After adding items you are need to add recipes for nails and planks, only then changing the recipe of wooden boxes.
See items and recipes here, but don't change they here:
Factorio\data\base\prototypes\item\demo-item.lua
Factorio\data\base\prototypes\item\item.lua
Factorio\data\base\prototypes\recipe\demo-recipe.lua
Factorio\data\base\prototypes\recipe\recipe.lua
Re: changing vanilla recipes
Did you see this modding tutorial yet?
You should use something like
You should use something like
Code: Select all
local new_chest = table.deepcopy(data.raw.recipe["wooden-chest"])
new_chest.ingredients = {
-- apply necessary changes to prototype
}
data:extend{new_chest}
A good mod deserves a good changelog. Here's a tutorial (WIP) about Factorio's way too strict changelog syntax!
-
- Manual Inserter
- Posts: 2
- Joined: Mon Nov 04, 2019 9:29 pm
- Contact:
Re: changing vanilla recipes
I was able to figure it out thanks to the help of you all.
Thank you very much.
Thank you very much.