Page 1 of 1

custom module

Posted: Sun Jul 17, 2022 2:34 pm
by AngelCookieModding
hello,

I am working on a custom machine for my mod and wondering how would I make a custom module. Simple it just sieves stone to ores. Hopefully, you get the idea I am not the best at getting the words from my head down into writing. Also sorry about my spelling.

example
default recipe 4 stone = 1 copper ore, 1 iron ore
copper sieve recipe 4 stone = 2 copper ore , 1 iron ore

Re: custom module

Posted: Sun Jul 17, 2022 10:57 pm
by DaveMcW

Code: Select all

local category = table.deepcopy(data.raw["recipe-category"]["basic-crafting"])
category.name = "sieve-crafting"
data:extend{category}

local machine = table.deepcopy(data.raw["assembling-machine"]["assembling-machine-2"])
machine.name = "sieve-machine"
machine.crafting_categories = {"sieve-crafting"}
data:extend{machine}

local recipe = table.deepcopy(data.raw["recipe"]["uranium-processing"])
recipe.name = "basic-sieve"
recipe.category = "sieve-crafting"
recipe.enabled = true
recipe.ingredients = { {"stone", 4} }
recipe.results = { {"copper-ore", 1}, {"iron-ore", 1} }
data:extend{recipe}

Re: custom module

Posted: Mon Jul 18, 2022 12:11 pm
by AngelCookieModding
Hello,

I already have the machine working and everything but thank you for the example. By custom module am trying to make something like the speed upgrade just it would be called a sieve. basic copper sieve 4 stone = 2 copper ore and 1 iron ore. Hopefully, this clears my help thread up.

Thanks for taking time to reply

Re: custom module

Posted: Mon Sep 12, 2022 5:22 pm
by BicycleEater
Normally you'd put it in as part of the recipe - what do you plan on it doing?