How to make an alternate recipe for a vanilla item?

Place to get help with not working mods / modding interface.
Post Reply
User avatar
bigyihsuan
Filter Inserter
Filter Inserter
Posts: 299
Joined: Thu Jan 01, 2015 12:57 pm
Contact:

How to make an alternate recipe for a vanilla item?

Post by bigyihsuan »

I'm trying to make a Stone-to-Steel Furnace mod, and I want to add a recipe that takes a Stone Furnace, Steel, and Stone Bricks to make a Steel Furnace.

How do I have the recipe appear right next to the Steel Furnace icon in the inventory recipe menu?

Code: Select all

--------------
--recipe.lua--
--------------
data:extend(
{
{
	type = "recipe",
	name = "stone-to-steel-furnace",
	enabled = "true",
	ingredients =
	{
		{"stone-furnace", 1},
		{"steel-plate", 8},
		{"stone-brick", 5}
	},
	result = "steel-furnace"
	}
}
)
------------
--item.lua--
------------
data:extend(
{
	{
		type = "item",
		name = "steel-furnace",
		icon = "__stone-to-steel-furnace-converter__/furnace-convert.png",
		flags = {"goes-to-quickbar"},
		subgroup = "smelting-machine",
		order = "c[stone-to-steel-furnace]",
		place_result = "steel-furnace",
		stack_size = 50
	}
}
)

johanwanderer
Fast Inserter
Fast Inserter
Posts: 157
Joined: Fri Jun 26, 2015 11:13 pm

Re: How to make an alternate recipe for a vanilla item?

Post by johanwanderer »

I don't think you need to re-add the steel-furnace item (unless that is not already in game) for the recipe to work. You can also look at Bob's mod. He has multiple recipes for the same item there.

orzelek
Smart Inserter
Smart Inserter
Posts: 3911
Joined: Fri Apr 03, 2015 10:20 am
Contact:

Re: How to make an alternate recipe for a vanilla item?

Post by orzelek »

Adding only recipe is ok.
Just make sure you require the file from your data.lua and it should work.
It will not appear immediately when you load game - you will need reset recipes:

Code: Select all

/c game.player.force.reset_recipes()

Post Reply

Return to “Modding help”