Code: Select all
local ores = {"iron", "copper", "uranium"}
local recipe_chain = {"ore", "dust", "enriched", "deoxidized", "particle", "smelted", "plate"}
local mod_name = '__My_Mod_Name_For_Ores_Enrichment__' -- you are need to change the mod name
local recipe_category = "enriching" -- nice name for enrichment
data:extend({
{
type = "recipe-category",
name = recipe_category
}
})
table.insert (data.raw["assembling-machine"].centrifuge.crafting_categories, recipe_category) -- for example in centrifuge
for i, ore_name in pairs (ores) do
for j = 2, #recipe_chain do
local name = ore_name .. "-" .. recipe_chain[j]
local ingredient_name = ore_name .. "-" .. recipe_chain[j-1]
data:extend({
{
type = "recipe",
category = recipe_category,
name = name,
enabled = "true",
energy_requied = 3,
ingredients =
{
{ingredient_name, 4}
},
results = {{name = name, type = "item", amount = 3}},
}
})
if not data.raw.item[name] then -- add item if you haven't it
data:extend({
{
type = "item",
name = name,
icon = mod_name.."/graphics/icons/"..name..".png", -- you are need to add icons here
icon_size = 32,
subgroup = "raw-resource",
order = "rc-"..i..'-'..j,
stack_size = 100
}
})
end
end
end