• Switch 1.4: New patch released Jan 18, details are here. Read the full release details here. Report bugs here.

tModLoader Coding Problems, Please Help.

mouseas

Steampunker
Here is a Link to a Download if you would like to tinker with it in any way, shape, or form.
I assume by "doesn't work", that you mean the mod doesn't give any errors, but the recipe won't show up.

I don't see any obvious things wrong in your code.

I assume you have the ingredients in your inventory rather than in equipment slots?

You might also need to make Lava Waders and Frostspark Boots count as being Materials, since they weren't previously used in any recipes. Lucky Horseshoe is used in some recipes already, so it should be fine.

You could also try adding a second recipe, just for debugging purposes:

Code:
    recipe = new ModRecipe(mod);
    recipe.AddIngredient(ItemID.DirtBlock, 1);
    recipe.SetResult(this);
    recipe.AddRecipe();

This should allow you to craft the boots from 1 dirt block, without being near any crafting stations. If that recipe doesn't show up, then "AddRecipes()" isn't being called, and the first recipe isn't being added in the first place.
 
i am trying to make a armor set but for some reason it keeps on saying

\ModLoader\Mod Sources\ExampleMod\Items\Armor\EnchantedGoldBreastplate.cs(35,31) : error CS1026: ) expected

this is my code

Code:
using Terraria;
using Terraria.ID;
using Terraria.ModLoader;

namespace ExampleMod.Items.Armor
{
    [AutoloadEquip(EquipType.Body)]
    public class EnchantedGoldBreastplate : ModItem
    {
        public override void SetStaticDefaults()
        {
            base.SetStaticDefaults();
            DisplayName.SetDefault("EnchantedGoldBreastplate");
            Tooltip.SetDefault("This Armor Plate is made from souls and gold."
                + "\nImmunity to 'ManaSickness!'");
        }

        public override void SetDefaults()
        {
            item.width = 18;
            item.height = 18;
            item.value = 10000;
            item.rare = 2;
            item.defense = 11;
        }

        public override void UpdateEquip(Player player)
        {
            player.buffImmune[BuffID.ManaSickness] = true;
        }

        public override void AddRecipes()
        {
            ModRecipe recipe = new ModRecipe(mod);
            recipe.AddIngredient(ItemID.83, 1);
            recipe.AddIngredient(ItemID.521, 7);
            recipe.AddTile(null, "Anvil");
            recipe.SetResult(this);
            recipe.AddRecipe();
        }
    }
}
 

jopojelly

Retinazer
tModLoader
i am trying to make a armor set but for some reason it keeps on saying

\ModLoader\Mod Sources\ExampleMod\Items\Armor\EnchantedGoldBreastplate.cs(35,31) : error CS1026: ) expected

this is my code

Code:
using Terraria;
using Terraria.ID;
using Terraria.ModLoader;

namespace ExampleMod.Items.Armor
{
    [AutoloadEquip(EquipType.Body)]
    public class EnchantedGoldBreastplate : ModItem
    {
        public override void SetStaticDefaults()
        {
            base.SetStaticDefaults();
            DisplayName.SetDefault("EnchantedGoldBreastplate");
            Tooltip.SetDefault("This Armor Plate is made from souls and gold."
                + "\nImmunity to 'ManaSickness!'");
        }

        public override void SetDefaults()
        {
            item.width = 18;
            item.height = 18;
            item.value = 10000;
            item.rare = 2;
            item.defense = 11;
        }

        public override void UpdateEquip(Player player)
        {
            player.buffImmune[BuffID.ManaSickness] = true;
        }

        public override void AddRecipes()
        {
            ModRecipe recipe = new ModRecipe(mod);
            recipe.AddIngredient(ItemID.83, 1);
            recipe.AddIngredient(ItemID.521, 7);
            recipe.AddTile(null, "Anvil");
            recipe.SetResult(this);
            recipe.AddRecipe();
        }
    }
}
Read https://github.com/blushiemagic/tModLoader/wiki/Basic-Recipes
 
Top Bottom