tModLoader Official tModLoader Help Thread

now it says
c:\Users\hp\Documents\My Games\Terraria\ModLoader\Mod Sources\YourModName\Items\MountItem.cs(18,29) : error CS0103: The name 'SoundID' it does not exist in the actual context. Now i should take out that and leave only 79;?
Add using Terraria.ID; to the top of your script.
 
like this?
using Terraria.ID; <-----(Change)
using Terraria.ModLoader;

namespace YourModName.Items
{
public class Balloon : ModItem
{
public override void SetDefaults()
{
item.name = "CoolSkull";
item.width = 20;
item.height = 30;
item.toolTip = "Weeeird.....";
item.useTime = 20;
item.useAnimation = 20;
item.useStyle = 1;
item.value = 300;
item.rare = 5;
item.UseSound = SoundID.Item1 <------(Change)
item.noMelee = true;
item.mountType = mod.MountType("Mount");
}


}
}
 
like this?
using Terraria.ID; <-----(Change)
using Terraria.ModLoader;

namespace YourModName.Items
{
public class Balloon : ModItem
{
public override void SetDefaults()
{
item.name = "CoolSkull";
item.width = 20;
item.height = 30;
item.toolTip = "Weeeird.....";
item.useTime = 20;
item.useAnimation = 20;
item.useStyle = 1;
item.value = 300;
item.rare = 5;
item.UseSound = SoundID.Item1 <------(Change)
item.noMelee = true;
item.mountType = mod.MountType("Mount");
}


}
}
There has to be a semicolon after Item1, but yes, I think that should work. You'll probably want to add using Terraria; as well, just to be on the safe side.

If it works, you can change Item1 back to Item79 (or whichever sound you want).
 
There has to be a semicolon after Item1, but yes, I think that should work. You'll probably want to add using Terraria; as well, just to be on the safe side.

If it works, you can change Item1 back to Item79 (or whichever sound you want).
that solved but now this:
Items/CoolSkull
en Terraria.ModLoader.Mod.GetTexture(String name)
en Terraria.ModLoader.ModLoader.GetTexture(String name)
en Terraria.ModLoader.Mod.SetupContent()
en Terraria.ModLoader.ModLoader.do_Load(Object threadContext)

The folder is called Items, the .cs file is called MountItem and the png the same
 
that solved but now this:
Items/CoolSkull
en Terraria.ModLoader.Mod.GetTexture(String name)
en Terraria.ModLoader.ModLoader.GetTexture(String name)
en Terraria.ModLoader.Mod.SetupContent()
en Terraria.ModLoader.ModLoader.do_Load(Object threadContext)

The folder is called Items, the .cs file is called MountItem and the png the same
Your class name and your file name have to be identical, otherwise it won't compile.
 
Your class name and your file name have to be identical, otherwise it won't compile.
so i create a folder and put the same name?
[doublepost=1492387964,1492387888][/doublepost]
so i create a folder and put the same name?
o wait i readed folder not file, i will check now
[doublepost=1492388220][/doublepost]
Your class name and your file name have to be identical, otherwise it won't compile.
it works¡¡¡¡
thanks a lot, when i do some things and upload the mod all of you will be in the credits
 
This looks like somehow you have an incomplete install. Are you sure you have tmodloaderserver.exe in the steam folder?[/QU
when u said did I have the thing in my steam folder, did u mean the one in the program files, or the terraria file?
and no its not in the folder labeled 'Steam'.
[doublepost=1492460177,1492460041][/doublepost]When u said the steam folder, u mean the folder in the program file labeled 'Steam' or the one in the steamapps folder?
and no its not there
 
Hey there folks, I need your help:

I'm making a mod with Tools and Weapons, but this string issue is giving me a headache:

Items/MoonBreaker
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)

I have already seen some replies with the same error, but I just can get what I did wrong (I made sure to have the Class name and the .png with the same name on the same folder, and the folder seems right to me) , I'll post my code too. Also I have tried erasing this item to see if the others work, but the other ones also gave me this error.

Here's the code:
Code:
using Terraria.ID;
using Terraria.ModLoader;

namespace TPMOD.Items
{
    public class MoonBreaker : ModItem ///If I'm right then the compiler should search for TPMOD.Items.MoonBreaker.MoonBreaker.png
    {
        public override void SetDefaults()
        {
            item.name = "Moon Breaker";
            item.damage = 102;
            item.melee = true;
            item.width = 48;
            item.height = 48;
            item.toolTip = "What? Now you can destroy the moon, what else do you need?";
            item.useTime = 5;
            item.useAnimation = 5;
            item.useStyle = 1;
            item.knockBack = 10;
            item.value = 10000;
            item.rare = 7;
            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();
        }
    }
}
 
that solved but now this:
Items/CoolSkull
en Terraria.ModLoader.Mod.GetTexture(String name)
en Terraria.ModLoader.ModLoader.GetTexture(String name)
en Terraria.ModLoader.Mod.SetupContent()
en Terraria.ModLoader.ModLoader.do_Load(Object threadContext)

The folder is called Items, the .cs file is called MountItem and the png the same
Can you post the
Hey there folks, I need your help:

I'm making a mod with Tools and Weapons, but this string issue is giving me a headache:

Items/MoonBreaker
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)

I have already seen some replies with the same error, but I just can get what I did wrong (I made sure to have the Class name and the .png with the same name on the same folder, and the folder seems right to me) , I'll post my code too. Also I have tried erasing this item to see if the others work, but the other ones also gave me this error.

Here's the code:
Code:
using Terraria.ID;
using Terraria.ModLoader;

namespace TPMOD.Items
{
    public class MoonBreaker : ModItem ///If I'm right then the compiler should search for TPMOD.Items.MoonBreaker.MoonBreaker.png
    {
        public override void SetDefaults()
        {
            item.name = "Moon Breaker";
            item.damage = 102;
            item.melee = true;
            item.width = 48;
            item.height = 48;
            item.toolTip = "What? Now you can destroy the moon, what else do you need?";
            item.useTime = 5;
            item.useAnimation = 5;
            item.useStyle = 1;
            item.knockBack = 10;
            item.value = 10000;
            item.rare = 7;
            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();
        }
    }
}
With the comment thing, not quite. It looks in TPMOD.Items for MoonBreaker.png, so make sure the file is called MoonBreaker with a capital M and B and that the .cs file also has a capital M and B.
 
Can you post the

With the comment thing, not quite. It looks in TPMOD.Items for MoonBreaker.png, so make sure the file is called MoonBreaker with a capital M and B and that the .cs file also has a capital M and B.
Ok, I think I got it, I needed to put TPMOD.Items.Moonbreaker instead of just TPMOD.Items; because I have inside Items 4 subfolders. Thank you!
 
Ok, I think I got it, I needed to put TPMOD.Items.Moonbreaker instead of just TPMOD.Items; because I have inside Items 4 subfolders. Thank you!
Unless an item is really important, I wouldn't recommend putting it in a folder, having say a melee weapons folder or a magic weapons folder is fine (and if you do so make sure to add .Magic or whatever after), but I find folders for individual items too much hassle and you can often forget about it. Glad it fixed the problem though! :D
 
I need help having my custom boss have a 1/3 chance of dropping my custom yoyo. I know how to do it with vanilla npcs, just not modded ones.
 
Back
Top Bottom