Dont know how to add a recipe code-wise
-
- Burner Inserter
- Posts: 8
- Joined: Fri Dec 08, 2017 10:20 pm
- Contact:
Dont know how to add a recipe code-wise
I want to add a recipe that does a type of ore refining that does this (this recipe comes with oil processing), in a chemical plant , put 5 ore and 10 light oil , get 6 ore , put 6 ore and 10 heavy oil , get 7 ore , put 7 ore and 10 petrolum gas get 8 ore , i want a example mod that i could work with if anyone could help , thanks!!!!!!
Re: Dont know how to add a recipe code-wise
As example:
Factorio\data\base\prototypes\recipe\fluid-recipe.lua
or
Just make new mod, info.json, then in data.lua add new code
For better modding you are need https://notepad-plus-plus.org/
Factorio\data\base\prototypes\recipe\fluid-recipe.lua
Code: Select all
{
type = "recipe",
name = "sulfuric-acid",
category = "chemistry",
energy_required = 1,
enabled = false,
ingredients =
{
{type="item", name="sulfur", amount=5},
{type="item", name="iron-plate", amount=1},
{type="fluid", name="water", amount=100}
},
results=
{
{type="fluid", name="sulfuric-acid", amount=50}
},
subgroup = "fluid-recipes",
crafting_machine_tint =
{
primary = {r = 0.875, g = 0.735, b = 0.000, a = 0.000}, -- #dfbb0000
secondary = {r = 0.103, g = 0.940, b = 0.000, a = 0.000}, -- #1aef0000
tertiary = {r = 0.564, g = 0.795, b = 0.000, a = 0.000}, -- #8fca0000
}
}
Code: Select all
{
type = "recipe",
name = "plastic-bar",
category = "chemistry",
energy_required = 1,
enabled = false,
ingredients =
{
{type="fluid", name="petroleum-gas", amount=20},
{type="item", name="coal", amount=1}
},
results=
{
{type="item", name="plastic-bar", amount=2}
},
crafting_machine_tint =
{
primary = {r = 0.498, g = 0.498, b = 0.498, a = 0.000}, -- #7f7f7f00
secondary = {r = 0.400, g = 0.400, b = 0.400, a = 0.000}, -- #66666600
tertiary = {r = 0.305, g = 0.305, b = 0.305, a = 0.000}, -- #4d4d4d00
}
}
Code: Select all
data:extend({
-- here
})



- bobingabout
- Smart Inserter
- Posts: 7352
- Joined: Fri May 09, 2014 1:01 pm
- Contact:
Re: Dont know how to add a recipe code-wise
if you do simply want to add recipes from existing items, follow the steps above (they're all quotes from the base game).
if you want new intermediate items (the ore in each step is actually a new one, not the original), you'll need to add those items too.
if you want new intermediate items (the ore in each step is actually a new one, not the original), you'll need to add those items too.
Re: Dont know how to add a recipe code-wise
Klonans old modding introduction is still worth paying attention to:
https://www.youtube.com/watch?v=8lPNOOVYeMU&t=932s
https://www.youtube.com/watch?v=8lPNOOVYeMU&t=932s