custom module

Place to get help with not working mods / modding interface.
Post Reply
AngelCookieModding
Manual Inserter
Manual Inserter
Posts: 2
Joined: Sun Jul 17, 2022 2:23 pm
Contact:

custom module

Post 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

User avatar
DaveMcW
Smart Inserter
Smart Inserter
Posts: 3700
Joined: Tue May 13, 2014 11:06 am
Contact:

Re: custom module

Post 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}

AngelCookieModding
Manual Inserter
Manual Inserter
Posts: 2
Joined: Sun Jul 17, 2022 2:23 pm
Contact:

Re: custom module

Post 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

BicycleEater
Fast Inserter
Fast Inserter
Posts: 153
Joined: Sun Jul 26, 2020 4:05 pm
Contact:

Re: custom module

Post by BicycleEater »

Normally you'd put it in as part of the recipe - what do you plan on it doing?

Post Reply

Return to “Modding help”