It took me some time to figure out how recipes work, just want to share my annotations with you.
Edit: I added a more detailed tutorial for the icons, below in post #3.
[RequiresSkill(typeof(BasicCraftingSkill), 0)] //skill used, level required
public class WaterWellBlockRecipe : Recipe //unique name of the recipe
{
public WaterWellBlockRecipe()
{
this.Products = new CraftingElement[]
{
new CraftingElement<WaterItem>(1), //what is crafted, ammount, can craft multible products at a time
};
this.Ingredients = new CraftingElement[] //can't be empty or zero, can use multible ingredients at a time
{
new CraftingElement<PlantFibersItem>(typeof(BasicCraftingEfficiencySkill), 0.1f, BasicCraftingEfficiencySkill.MultiplicativeStrategy),
};
this.CraftMinutes = CreateCraftTimeValue(typeof(WaterWellBlockRecipe), Item.Get<WaterItem>().UILink(), 0.1f, typeof(BasicCraftingSpeedSkill)); //from arrows recipe, 2 sec at max lvl
this.Initialize("Water", typeof(WaterWellBlockRecipe)); //visible name at the crafting station
CraftingComponent.AddRecipe(typeof(TraditionalWaterWellObject), this); //where is it crafted
}
}
Display More
If you don't know where to use this, check https://github.com/StrangeLoopGam…iling-Fan-Light
Tip: If you only want to create a new ingredient for cooking or crafting or a food item, you can skip the whole "Initial Object Setup" part and everything below "Sending Custom Interactions" from the above tutorial. You only need to create an icon in unity3d and a working .cs file. (proper .cs files even work without an icon/unity file, uses template icon then)
And don't reinvent the wheel for the icon (just because the tutorial tells you), there are so many nice free graphics out in the wild. (e.g. http://pngimg.com/ or http://game-icons.net/)