Standalone [1.3] tModLoader - A Modding API

make sure the name of it is the same as you wrote here namespace Randomness.Items.Weapons
So the name of the of sprite and the cs file of it should be the same right?

Edit: so the name of the sprite should be Randomness?
 
no the sprite name has to be the same as here
using System;
using Microsoft.Xna.Framework;
using Terraria;
using Terraria.Graphics.Effects;
using Terraria.Graphics.Shaders;
using Terraria.ID;
using Terraria.ModLoader;

namespace Randomness.Items.Weapons
{
public class ExampleHammer : ModItem
{
public override void SetDefaults()
{
item.name = "Example Hammer";
item.damage = 100;
item.melee = true;
item.width = 90;
item.height = 90;
item.toolTip = "This is a modded Hammer";
item.useTime = 25;
item.useAnimation = 25;
item.useStyle = 1;
item.knockBack = 20;
item.value = 100;
item.rare = 10;
item.useSound = 1;
item.autoReuse = true;
item.useTurn = true;
}
public override void AddRecipes()
{
ModRecipe recipe = new ModRecipe(mod);
recipe.AddIngredient(ItemID.DirtBlock, 1);
recipe.AddTile(TileID.WorkBenches);
recipe.SetResult(this);
recipe.AddRecipe();

}
}
}
[doublepost=1462399733,1462399674][/doublepost]sorry I meant ExampleHammer its has to be called ExampleHammer
 
ya I meant ExampleHammer
 
no the sprite name has to be the same as here
using System;
using Microsoft.Xna.Framework;
using Terraria;
using Terraria.Graphics.Effects;
using Terraria.Graphics.Shaders;
using Terraria.ID;
using Terraria.ModLoader;

namespace Randomness.Items.Weapons
{
public class ExampleHammer : ModItem
{
public override void SetDefaults()
{
item.name = "Example Hammer";
item.damage = 100;
item.melee = true;
item.width = 90;
item.height = 90;
item.toolTip = "This is a modded Hammer";
item.useTime = 25;
item.useAnimation = 25;
item.useStyle = 1;
item.knockBack = 20;
item.value = 100;
item.rare = 10;
item.useSound = 1;
item.autoReuse = true;
item.useTurn = true;
}
public override void AddRecipes()
{
ModRecipe recipe = new ModRecipe(mod);
recipe.AddIngredient(ItemID.DirtBlock, 1);
recipe.AddTile(TileID.WorkBenches);
recipe.SetResult(this);
recipe.AddRecipe();

}
}
}
[doublepost=1462399733,1462399674][/doublepost]sorry I meant ExampleHammer its has to be called ExampleHammer
oh
 
I just wrote it wrong and make sure its in the same folder as your wrote
namespace Randomness.Items.Weapons
 
so it should be like this?
Code:
using System;
using Microsoft.Xna.Framework;
using Terraria;
using Terraria.Graphics.Effects;
using Terraria.Graphics.Shaders;
using Terraria.ID;
using Terraria.ModLoader;

namespace ExampleHammer.Items.Weapons
{
    public class ExampleHammer : ModItem
    {
        public override void SetDefaults()
        {
            item.name = "Example Hammer";
            item.damage = 100;
            item.melee = true;
            item.width = 90;
            item.height = 90;
            item.toolTip = "This is a modded Hammer";
            item.useTime = 25;
            item.useAnimation = 25;
            item.useStyle = 1;
            item.knockBack = 20;
            item.value = 100;
            item.rare = 10;
            item.useSound = 1;
            item.autoReuse = true;
            item.useTurn = true;
        }
        public override void AddRecipes()
        {
            ModRecipe recipe = new ModRecipe(mod);
            recipe.AddIngredient(ItemID.DirtBlock, 1);
            recipe.AddTile(TileID.WorkBenches);
            recipe.SetResult(this);
            recipe.AddRecipe();

        }
    }
}
 
the code is fine just make sure tha name of the sprite is the same as your wrote in the code here:
public class ExampleHammer : ModItem
and the sprite is in the folder is in the same place a you wrote here:
namespace ExampleHammer.Items.Weapons
and change back the Randomness I meant something else
 
the code is fine just make sure tha name of the sprite is the same as your wrote in the code here:
public class ExampleHammer : ModItem
and the sprite is in the folder is in the same place a you wrote here:
namespace ExampleHammer.Items.Weapons
and change back the Randomness I meant something else
This is how I have it:
Capture.PNG
 
ya and crop the image dont let any free space be left
 
ya and crop the image dont let any free space be left
I don't know how to do that can u do?


Edit: Btw its been like that the whole time
 
yup just post it here
 
here check the dirrence
vaZ2goB.png
 
here check the dirrence
vaZ2goB.png
I still get this
Code:
Items/Weapons/ExampleHammer
   at Terraria.ModLoader.Mod.GetTexture(String name)
   at Terraria.ModLoader.ModLoader.GetTexture(String name)
   at Terraria.ModLoader.Mod.SetupContent()
   at Terraria.ModLoader.ModLoader.do_Load(Object threadContext)
And here is the code of it:
Code:
using System;
using Microsoft.Xna.Framework;
using Terraria;
using Terraria.Graphics.Effects;
using Terraria.Graphics.Shaders;
using Terraria.ID;
using Terraria.ModLoader;

namespace Randomness.Items.Weapons
{
    public class ExampleHammer : ModItem
    {
        public override void SetDefaults()
        {
            item.name = "Example Hammer";
            item.damage = 100;
            item.melee = true;
            item.width = 90;
            item.height = 90;
            item.toolTip = "This is a modded Hammer";
            item.useTime = 25;
            item.useAnimation = 25;
            item.useStyle = 1;
            item.knockBack = 20;
            item.value = 100;
            item.rare = 10;
            item.useSound = 1;
            item.autoReuse = true;
            item.useTurn = true;
        }
        public override void AddRecipes()
        {
            ModRecipe recipe = new ModRecipe(mod);
            recipe.AddIngredient(ItemID.DirtBlock, 1);
            recipe.AddTile(TileID.WorkBenches);
            recipe.SetResult(this);
            recipe.AddRecipe();

        }
    }
}
And here what it looks like in the folders:
Capture.PNG

Now can you figure it out?
 
I think everything looks fine
 
Is it something with this:
Code:
using System;
using Microsoft.Xna.Framework;
using Terraria;
using Terraria.Graphics.Effects;
using Terraria.Graphics.Shaders;
using Terraria.ID;
using Terraria.ModLoader;

namespace Randomness
{
    public class Randomness : Mod
    {
        public Randomness()
        {
            Properties = new ModProperties()
            {
                Autoload = true,
                AutoloadGores = true,
                AutoloadSounds = true
            };
        }
    }
}
 
I never did a simlar code like this so am afraid I cant help you
[doublepost=1462401422,1462401378][/doublepost]whats the error?
 
Code:
[CODE]Items/Weapons/ExampleHammer

   at Terraria.ModLoader.Mod.GetTexture(String name)

   at Terraria.ModLoader.ModLoader.GetTexture(String name)

   at Terraria.ModLoader.Mod.SetupContent()

   at Terraria.ModLoader.ModLoader.do_Load(Object threadContext)

[/CODE]And all I'm trying to do is to get it were I can add items into it
 
I never did a simlar code like this so am afraid I cant help you
[doublepost=1462401422,1462401378][/doublepost]whats the error?
Do you know how to just get it ready for adding weapons?
 
Back
Top Bottom