Standalone [1.3] tModLoader - A Modding API

been getting this all day on both of my pc's
The mp3 sound file at Sounds/Music/CaveStoryBossBattle.mp3 failed to load
at Terraria.ModLoader.Mod.Autoload()
at Terraria.ModLoader.ModLoader.do_Load(Object threadContext)

Inner Exception:
Ensure that the specified stream contains valid PCM mono or stereo wave data.
at Microsoft.Xna.Framework.Audio.WavFile..ctor(Stream source)
at Microsoft.Xna.Framework.Audio.WavFile.Open(Stream stream)
at Microsoft.Xna.Framework.Audio.SoundEffect..ctor(Stream stream)
at Microsoft.Xna.Framework.Audio.SoundEffect.FromStream(Stream stream)
at Terraria.ModLoader.Mod.Autoload()
 
So, with the transition and updates of tmodloader, I have tried to fix the scripts for my pets and mounts. Yet, whenever I replace lines such as 'item.name' with 'DisplayName.SetDefault("")' it always comes up with and error saying that DisplayName does not exist in the current context, I am fairly new with coding, please help?
 
Hello all. I was wondering if anyone had access to an index of all player class properties, such as player.meleeDamage and player.lifeRegen.
[doublepost=1500142480,1500142222][/doublepost]
Nevermind, I found all of the properties in decompiled player.cs. If anyone has a similar question, here is a file on [link removed by staff]
I needed to edit your post to remove the link you provided. Links to decompiled Terraria are not permitted. Any questions, please send me a private message.
 
So I got this minor issue when trying to build my mod since some days:

error CS1703: An assembly with the same identity 'Ionic.Zip.Reduced, Version=1.9.1.8, Culture=neutral, PublicKeyToken=edbe51ad942a3f5c' has already been imported. Try removing one of the duplicate references.

I already re-installed Terraria and tMod
There is NO file on my whole system with an Ionic.x.x.dll
 
How do I make my item point to where my cursor is (Like a staff)? (When using Right-Click)
This is what comes up:
Capture.PNG
Code:
using System;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Graphics;
using Terraria;
using Terraria.ID;
using Terraria.ModLoader;

namespace JoshuasMod.Items.Weapons.DragonDancer
{
    public class DragonDancer : ModItem
    {
        public override void SetStaticDefaults()
        {
            DisplayName.SetDefault("Dragon Dancer");    //The weapon's name when shown in-game.
        }
     
        public override void SetDefaults()
        {
            item.useStyle = 1;    //The way your Weapon will be used, 1 is the regular sword swing.
            item.UseSound = SoundID.Item71; //The sound played when using your Weapon. "Item71" is the Death Sickle's swing sound.
            item.damage = 1000;
            item.width = 34;    //The size of the width of the hitbox in pixels.
            item.height = 34;    //The size of the height of the hitbox in pixels.
            item.useTime = 8;   //How fast the Weapon is used.
            item.useAnimation = 8;     //How long the Weapon is used for.
            item.autoReuse = true;
            item.noMelee = false;
            item.melee = false;
            item.expert = true;
            item.useTurn = true;
            item.shoot = 0;
            }
         
            public override bool AltFunctionUse(Player player)
        {
            return true;
        }

        public override bool CanUseItem(Player player)
        {
            if (player.altFunctionUse == 2)
            {
            item.useStyle = 5;    //The way your Weapon will be used, 5 is for holding out (Guns, Spellbooks, and the like).
            item.UseSound = SoundID.Item71; //The sound played when using your Weapon. "Item71" is the Death Sickle's swing sound.
            item.damage = 1000;
            item.width = 34;    //The size of the width of the hitbox in pixels.
            item.height = 34;    //The size of the height of the hitbox in pixels.
            item.useTime = 10;   //How fast the Weapon is used.
            item.useAnimation = 10;     //How long the Weapon is used for.
            item.channel = true;
            item.autoReuse = true;
            item.noMelee = true;
            item.useTurn = false;
            item.melee = false;
            item.expert = true;
            item.shoot = mod.ProjectileType("DragonStorm1");
            item.shootSpeed = 32f;
            }
            else
            {
            item.useStyle = 1;    //The way your Weapon will be used, 1 is the regular sword swing.
            item.UseSound = SoundID.Item71; //The sound played when using your Weapon. "Item71" is the Death Sickle's swing sound.
            item.damage = 1000;
            item.width = 34;    //The size of the width of the hitbox in pixels.
            item.height = 34;    //The size of the height of the hitbox in pixels.
            item.useTime = 8;   //How fast the Weapon is used.
            item.useAnimation = 8;     //How long the Weapon is used for.
            item.autoReuse = true;
            item.noMelee = false;
            item.melee = false;
            item.expert = true;
            item.useTurn = true;
            item.shoot = 0;
            }
            return base.CanUseItem(player);
        }

        public override void OnHitNPC(Player player, NPC target, int damage, float knockback, bool crit)
        {
            target.AddBuff(BuffID.CursedInferno, 5 * 60);        //Add CursedInferno buff to the NPC for 5 seconds.

            int healingAmount = damage/40;
            player.statLife +=healingAmount;
            player.HealEffect(healingAmount, true);
        }
     
        // The Projectile's "Shoot" Function [Inaccurate Gun Style]
        public override bool Shoot(Player player, ref Vector2 position, ref float speedX, ref float speedY, ref int type, ref int damage, ref float knockBack)
        {
            Vector2 perturbedSpeed = new Vector2(speedX, speedY).RotatedByRandom(MathHelper.ToRadians(5)); // "5" is the angle of degrees where the projectiles can shoot within.
            speedX = perturbedSpeed.X;
            speedY = perturbedSpeed.Y;
            return true;
        }
     
        public override Vector2? HoldoutOffset()
        {
            return new Vector2(10, 0);
        }
    }
}
 
Last edited:
hey, i've been having problems where i get errors while loading. It says it disabled the mod cause it failed to load a png or mp3. I have all the mods updated as well as the latest version of tmodloader. It seems that the only way to fix it is to disable all mods, reload, restart terraria, then load your mods. It's kind of a pain and I'm wondering if this is an already known problem and if there is an easy fix.
upload_2017-7-22_0-27-31.png
 
How do I add vanilla dust to a Projectile and a Sword when it's being used? I want it to have the "Green Cursed Torch" Dust (Which has an ID number of 75).
 
Hello everyone!
I started to create my very first mod just for fun. And while i wanted to Build it in terraria i got an error.
There's a message:

An error ocurred while compiling mod.

c:\\\Documents\My Games\Terraria\ModLoader\Mod\Sources\AscartosElderity\AscartosElderity\obj\Debug\App.g.i.cs(16,22)
error CS0234: Name of type or namespace ,,Automation" Does not exist in namespace ,,System.Windows" (Is there a shortlist for the kit?).

I was searching and I couldn't find anything useful about it :/
I had to translate the message cause i have my VS in polish version :V.
 
Hello everyone!
I started to create my very first mod just for fun. And while i wanted to Build it in terraria i got an error.
There's a message:

An error ocurred while compiling mod.

c:\\\Documents\My Games\Terraria\ModLoader\Mod\Sources\AscartosElderity\AscartosElderity\obj\Debug\App.g.i.cs(16,22)
error CS0234: Name of type or namespace ,,Automation" Does not exist in namespace ,,System.Windows" (Is there a shortlist for the kit?).

I was searching and I couldn't find anything useful about it :/
I had to translate the message cause i have my VS in polish version :V.

You have VS configured to build a WPF (Windows Presentation Forms) app, not a tModLoader module. Follow the guide at https://github.com/blushiemagic/tModLoader/wiki/Developing-with-Visual-Studio and you should be able to resolve it.
 
hey, i've been having problems where i get errors while loading. It says it disabled the mod cause it failed to load a png or mp3. I have all the mods updated as well as the latest version of tmodloader. It seems that the only way to fix it is to disable all mods, reload, restart terraria, then load your mods. It's kind of a pain and I'm wondering if this is an already known problem and if there is an easy fix.View attachment 177294
I've been getting similar errors for the mods I have as well!

Also, I have a question regarding characters. If you have a character with modded items, and the mod that the items are from are disabled, could you still keep the items the character had if you don't select Single Player until you re-enable the mod? (my apologies if that question made no sense)

Also also, Gigalith, did doing all that (with the reloading and restarting and such) affect any worlds or characters with modded items?
 
Last edited:
It would be nice if there was an option to reload the mods immediately when one mod fails to load, instead of waiting for all the mods to load, going through all your mods to enable the not-loaded mods again because it keeps disabling them because some random background music failed to load
[doublepost=1500771297,1500771111][/doublepost]
It would be nice if there was an option to reload the mods immediately when one mod fails to load, instead of waiting for all the mods to load, going through all your mods to enable the not-loaded mods again because it keeps disabling them because some random background music failed to load
Or at least have an option to sort the mods by "recently failed to load" so I don't have to scroll through every mod I have enabled or disabled and enable the not-loaded by just memory
 
My apologies if my message sounded aggressive, I've been trying to reload this huge amount of mods but then I'll get this error message that "duckling_sound.mp3" has failed loading or something and my mind just starts screaming to the screen that loading the rest of the mods is useless as I need that mod it just failed to load, with or without duckling sounds, and that I need to go enable the mod again and try reloading the same mods once again.
Also, it seems like other people are having same problems with mods not loading due to a single audio file so that's cool, it's not just this massive modpack I'm using
 
My apologies if my message sounded aggressive, I've been trying to reload this huge amount of mods but then I'll get this error message that "duckling_sound.mp3" has failed loading or something and my mind just starts screaming to the screen that loading the rest of the mods is useless as I need that mod it just failed to load, with or without duckling sounds, and that I need to go enable the mod again and try reloading the same mods once again.
Also, it seems like other people are having same problems with mods not loading due to a single audio file so that's cool, it's not just this massive modpack I'm using
I've tried this and it works: Disable all your mods, reload them so they can be disabled completely, restart Terraria, re-enable mods you want to use, reload mods again. I hope this helps in some way!
 
Feld nicht gefunden: "Terraria.Item.toolTip2".
bei TrueEater.GlobalTrueItem.SetDefaults(Item item)
bei Terraria.ModLoader.ItemLoader.SetDefaults(Item item, Boolean createModItem)
bei Terraria.ModLoader.Mod.SetupContent()
bei Terraria.ModLoader.ModLoader.do_Load(Object threadContext)

this error ocures all the time and i dont know hoe to fix it it is probably a old mod that i used it sais that the mod is automaticly disabled but there is still te same error can someone help
 
hi could somebody help me ive added a few mods like calamity and thorium but when i try and reload them it says the mp3 files have failed or some other files have failed can somebody help?
 
hi could somebody help me ive added a few mods like calamity and thorium but when i try and reload them it says the mp3 files have failed or some other files have failed can somebody help?
After new update of CalamityMod everyone has this problem, it wasnt been solved yet, also I think its fault by side of Authors of the Mod.
 
Field not found: 'Terraria.Entity.name'.
at imkSushisNamePack.imkSushisNamePackGlobalItem.SetDefaults(Item item)
at Terraria.ModLoader.ItemLoader.SetDefaults(Item item, Boolean createModItem)
at Terraria.ModLoader.Mod.SetupContent()
at Terraria.ModLoader.ModLoader.do_Load(Object threadContext)


HELP PLEASE!!!!!!!!!!!!!!!!!!
[doublepost=1500846816,1500846419][/doublepost]
upload_2017-7-23_23-53-25.png
HELPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPP PLS
 
Back
Top Bottom