Page 1 of 1

How to make an alternate recipe for a vanilla item?

Posted: Tue Jul 21, 2015 6:21 pm
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
	}
}
)

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

Posted: Tue Jul 21, 2015 6:42 pm
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.

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

Posted: Tue Jul 21, 2015 6:52 pm
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()