tModLoader imkSushi's Mod

Could you send me the code in a conversation because I was trying to add crafting recipes my self and I can't get it quite right. I wouldn't take any of the code as my own and once I figure it out I would like to help contribute to this mod.
 
Here is my code could you tell me where I went wrong. I am trying to build the mod in just one file.
Code:
using System;
using Microsoft.Xna.Framework;
using Terraria;
using Terraria.ID;
using Terraria.ModLoader;

namespace Craftingrecipes
{
    public class Craftingrecipes : Mod
    {
        public override void SetModInfo(out string name, ref ModProperties properties)
        {
            name = "Craftingrecipes";
            properties.Autoload = true;
        }   
        public override void Load()
        {

        }
        public override void AddRecipes(Mod mod)
        {
            ModRecipe recipe= new ModRecipe(mod);
            recipe.AddIngredient(null, "ItemId.StoneBlock", 10);
            recipe.AddIngredient(null, "ItemId.Silk", 10);
            recipe.AddIngredient(null, "ItemId.Wood", 10);
            recipe.SetResult("ItemId.Aglet", 1);
            recip.Addrecipe();

        }
    }
}
went wrong.
 
Here is my code could you tell me where I went wrong. I am trying to build the mod in just one file.
Code:
using System;
using Microsoft.Xna.Framework;
using Terraria;
using Terraria.ID;
using Terraria.ModLoader;

namespace Craftingrecipes
{
    public class Craftingrecipes : Mod
    {
        public override void SetModInfo(out string name, ref ModProperties properties)
        {
            name = "Craftingrecipes";
            properties.Autoload = true;
        }  
        public override void Load()
        {

        }
        public override void AddRecipes(Mod mod)
        {
            ModRecipe recipe= new ModRecipe(mod);
            recipe.AddIngredient(null, "ItemId.StoneBlock", 10);
            recipe.AddIngredient(null, "ItemId.Silk", 10);
            recipe.AddIngredient(null, "ItemId.Wood", 10);
            recipe.SetResult("ItemId.Aglet", 1);
            recip.Addrecipe();

        }
    }
}
went wrong.
You also need a build.txt, which has all the mod info, and I suggest having it in two separate files ( recipehelper.cs and 'whatever your mod name is'.cs)
Second, if it is a vanilla terraria item, then you do not need the 'null, ' before it, or the quotation marks, it can be just 'recipe.AddIngridient(ItemId.Silk, 10);'
Third, if there is only one of the items that you need, then you do not need to put the ', 1' after it.
 
I made the changes that you suggested but I keep getting a log that says their is no mother to override in the Terraria.Modloader.Mod

build.txt
Code:
author = eatintoast
version = v.10
displayName = craftingrecipes

recipehelper.cs
Code:
using System;
using Microsoft.Xna.Framework;
using Terraria;
using Terraria.ID;
using Terraria.ModLoader;

namespace Craftingrecipes
{
    public class RecipeHelper
    {
        public override void AddRecipes(Mod mod)
        {
            ModRecipe recipe= new ModRecipe(mod);
            recipe.AddIngredient(ItemId.StoneBlock, 10);
            recipe.AddIngredient(ItemId.Silk, 10);
            recipe.AddIngredient(ItemId.Wood, 10);
            recipe.SetResult(ItemId.Aglet);
            recip.Addrecipe();

        }
    }
}

craftingrecipes.cs
Code:
using System;
using Microsoft.Xna.Framework;
using Terraria;
using Terraria.ID;
using Terraria.ModLoader;

namespace Craftingrecipes
{
    public class Craftingrecipes : Mod
    {
        public override void SetModInfo(out string name, ref ModProperties properties)
        {
            name = "Craftingrecipes";
            properties.Autoload = true;
            properties.AutoloadGores = true;
            properties.AutoloadSounds = true;
        }
        public override void Load()
        {
           
        }
        public override void AddRecipes()
        {

        }
    }
}
 
I made the changes that you suggested but I keep getting a log that says their is no mother to override in the Terraria.Modloader.Mod

build.txt
Code:
author = eatintoast
version = v.10
displayName = craftingrecipes

recipehelper.cs
Code:
using System;
using Microsoft.Xna.Framework;
using Terraria;
using Terraria.ID;
using Terraria.ModLoader;

namespace Craftingrecipes
{
    public class RecipeHelper
    {
        public override void AddRecipes(Mod mod)
        {
            ModRecipe recipe= new ModRecipe(mod);
            recipe.AddIngredient(ItemId.StoneBlock, 10);
            recipe.AddIngredient(ItemId.Silk, 10);
            recipe.AddIngredient(ItemId.Wood, 10);
            recipe.SetResult(ItemId.Aglet);
            recip.Addrecipe();

        }
    }
}

craftingrecipes.cs
Code:
using System;
using Microsoft.Xna.Framework;
using Terraria;
using Terraria.ID;
using Terraria.ModLoader;

namespace Craftingrecipes
{
    public class Craftingrecipes : Mod
    {
        public override void SetModInfo(out string name, ref ModProperties properties)
        {
            name = "Craftingrecipes";
            properties.Autoload = true;
            properties.AutoloadGores = true;
            properties.AutoloadSounds = true;
        }
        public override void Load()
        {
          
        }
        public override void AddRecipes()
        {

        }
    }
}
Your craftingrecipes.cs should look like:
Code:
using System;
using Microsoft.Xna.Framework;
using Terraria;
using Terraria.ID;
using Terraria.ModLoader;

namespace Craftingrecipes {
public class Craftingrecipes : Mod
{
       public override void SetModInfo(out string name, ref ModProperties properties)
    {
        name = "Craftingrecipes";
        properties.Autoload = true;
    }
        public override void AddRecipes()
    {
        RecipeHelper.AddRecipes(this);
    }
}}
I think that that should work.
 
Im still getting the same log when compiling
Code:
c:\Users\~\Documents\My Games\Terraria\ModLoader\Mod Sources\Craftingrecipes\recipehelper.cs(11,24) : error CS0115: 'Craftingrecipes.RecipeHelper.AddRecipes(Terraria.ModLoader.Mod)': no suitable method found to override
 
Im still getting the same log when compiling
Code:
c:\Users\~\Documents\My Games\Terraria\ModLoader\Mod Sources\Craftingrecipes\recipehelper.cs(11,24) : error CS0115: 'Craftingrecipes.RecipeHelper.AddRecipes(Terraria.ModLoader.Mod)': no suitable method found to override
I confess that I don't know. The coordinates
'c:\Users\~\Documents\My Games\Terraria\ModLoader\Mod Sources\Craftingrecipes\recipehelper.cs(11,24)'
says that there is a problem at line 11 column (or letter) 24 of your recipehelper.cs file. Try to figure out what might logicaly be wrong. I'm going to bed now, so I will not be around to reply till tomorrow morning.
 
The problem is that I am not good with repetitive tasks, and I get bored easily. If enough people show support for the mod, I can work on it after 28th Jan (I have stuff until then).
just starting some new cooment to bring some attention on the mod...
cause i like it but i know how it is boring for make something looking for texts
hope you get the motivation you need to continue :guidesmile:
 
Hey, I want to get your mod SUPER bad, but I put in the tModLoader mods folder, but it doesn't show up in my mods! Is this my mistake or a glitch?
[DOUBLEPOST=1453943322,1453943273][/DOUBLEPOST]Oh, is it not updated for tModLoader 0.7?
 
Back
Top Bottom