[SOLVED] How do you change default recipes?

Place to get help with not working mods / modding interface.
ATMunn
Inserter
Inserter
Posts: 37
Joined: Thu Jan 12, 2017 2:22 am
Contact:

[SOLVED] How do you change default recipes?

Post by ATMunn »

Hi there,

I'm just starting out modding and I thought of an idea for a simple but useful mod I could make that would change some default recipes. However, I don't know how to do that. My guess would be that I can just set it up like I'm going to make my own recipe, but instead of putting in a new name, putting in a name of a recipe from the base game. Part of me thinks this would work fine, although the other part of me thinks it's going to be much more complicated than that. Can someone let me know the answer? I would go ahead and try it but I don't want to waste my time on something that might not work at all.

EDIT: Looks like it is pretty simple, but not exactly what I thought it was. See Daniel34's post if you're wondering how yourself.
Last edited by ATMunn on Sun Jan 22, 2017 12:19 am, edited 1 time in total.
daniel34
Global Moderator
Global Moderator
Posts: 2761
Joined: Thu Dec 25, 2014 7:30 am
Contact:

Re: How do you change default recipes?

Post by daniel34 »

You can change the ingredients list by doing something like that in your data.lua file:

Code: Select all

data.raw.recipe["transport-belt"].ingredients =
{
	{"copper-plate", 1},
	{"iron-gear-wheel", 2}
}
This example changes the transport belt recipe, it doubles the amount of iron gears needed and changes the iron plate to copper plate.

You can see how existing recipes are implemented in your Factorio folder in data\base\prototypes\recipe. You then just need to add an info.json file with your mod description/version/... and you're done.

I've also attached a sample mod.
Attachments
recipe-example_1.0.0.zip
(745 Bytes) Downloaded 721 times
quick links: log file | graphical issues | wiki
ATMunn
Inserter
Inserter
Posts: 37
Joined: Thu Jan 12, 2017 2:22 am
Contact:

Re: How do you change default recipes?

Post by ATMunn »

I see, thanks. I'll update the main post so other people wondering the same thing can know how to do it.
Post Reply

Return to “Modding help”