tModLoader Official tModLoader Help Thread

How exactly do I get friends to join a modded Tserver? I've simply let the port be 7777 and let it auto-port when it said to, but my friend can't join. We tried joining via steam and via my IP but no such luck. Did I do anything wrong?
 
Hello i am having a problem with these leggings i made if anyone can help me out that would be awesome
the error is
Items/Armor/QuasarLegings_Legs
at Terraria.ModLoader.Mod.GetTexture(String name)
at Terraria.ModLoader.ModLoader.GetTexture(String name)
at Terraria.ModLoader.Mod.AddEquipTexture(EquipTexture equipTexture, ModItem item, EquipType type, String name, String texture, String armTexture, String femaleTexture)
at Terraria.ModLoader.Mod.AddEquipTexture(ModItem item, EquipType type, String name, String texture, String armTexture, String femaleTexture)
at Terraria.ModLoader.Mod.AutoloadItem(Type type)
at Terraria.ModLoader.Mod.Autoload()
at Terraria.ModLoader.ModLoader.do_Load(Object threadContext)

here is the code

using System;
using System.Collections.Generic;
using Terraria;
using Terraria.ID;
using Terraria.ModLoader;

namespace utilization.Items.Armor
{
[AutoloadEquip(EquipType.Legs)]
public class QuasarLegings : ModItem

{
public override void SetStaticDefaults()
{
DisplayName.SetDefault("Quasar Leggings");
Tooltip.SetDefault("burn the sky."
+ "\n5% increased movement speed");
}

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

public override void UpdateEquip(Player player)
{
player.moveSpeed += 0.50f;
}

public override void AddRecipes()
{
ModRecipe recipe = new ModRecipe(mod);
recipe.AddIngredient(ItemID.SpectreBar, 80);
recipe.AddTile(TileID.MythrilAnvil);
recipe.SetResult(this);
recipe.AddRecipe();
}
}
}
 
Hello i am having a problem with these leggings i made if anyone can help me out that would be awesome
the error is
Items/Armor/QuasarLegings_Legs
at Terraria.ModLoader.Mod.GetTexture(String name)
at Terraria.ModLoader.ModLoader.GetTexture(String name)
at Terraria.ModLoader.Mod.AddEquipTexture(EquipTexture equipTexture, ModItem item, EquipType type, String name, String texture, String armTexture, String femaleTexture)
at Terraria.ModLoader.Mod.AddEquipTexture(ModItem item, EquipType type, String name, String texture, String armTexture, String femaleTexture)
at Terraria.ModLoader.Mod.AutoloadItem(Type type)
at Terraria.ModLoader.Mod.Autoload()
at Terraria.ModLoader.ModLoader.do_Load(Object threadContext)

here is the code

using System;
using System.Collections.Generic;
using Terraria;
using Terraria.ID;
using Terraria.ModLoader;

namespace utilization.Items.Armor
{
[AutoloadEquip(EquipType.Legs)]
public class QuasarLegings : ModItem

{
public override void SetStaticDefaults()
{
DisplayName.SetDefault("Quasar Leggings");
Tooltip.SetDefault("burn the sky."
+ "\n5% increased movement speed");
}

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

public override void UpdateEquip(Player player)
{
player.moveSpeed += 0.50f;
}

public override void AddRecipes()
{
ModRecipe recipe = new ModRecipe(mod);
recipe.AddIngredient(ItemID.SpectreBar, 80);
recipe.AddTile(TileID.MythrilAnvil);
recipe.SetResult(this);
recipe.AddRecipe();
}
}
}
I suggest updating to 0.10.1.1 so you get a more relevant error message, also read this: https://github.com/blushiemagic/tMo...rrariamodloadermodgettexturestring-name-error

How exactly do I get friends to join a modded Tserver? I've simply let the port be 7777 and let it auto-port when it said to, but my friend can't join. We tried joining via steam and via my IP but no such luck. Did I do anything wrong?
https://github.com/blushiemagic/tModLoader/wiki/Debugging-Multiplayer-Usage-Issues
 
can anyone help me with this?
3GwcPtO.png


was trying to build Cheat Sheet using the tmodloader instead of using the already built cheatsheet.tmod

(i didnt change anything from the base code yet, just wanted to see if it built once before i started changing it)
 
Anyone know how to make it so that an enemy and its variants drop a custom item because i tried and only the original normal variant drops the item
Code:
using Microsoft.Xna.Framework;
using Terraria;
using Terraria.ID;
using Terraria.ModLoader;

namespace NicksMod.NPCs
{
    public class GlobalNPCs : GlobalNPC
    {
        public override void NPCLoot(NPC npc)
        {
            if (npc.type == NPCID.Zombie)
            {
                if (Main.rand.Next(2) == 0)   //item rarity
                {
                    Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("RustyMetal"), Main.rand.Next(1, 2));
                }
                if (npc.type == NPCID.BaldZombie)
                {
                    if (Main.rand.Next(2) == 0)   //item rarity
                    {
                        Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("RustyMetal"), Main.rand.Next(1, 2));
                    }
                    if (npc.type == NPCID.PincushionZombie)
                    {
                        if (Main.rand.Next(2) == 0)   //item rarity
                        {
                            Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("RustyMetal"), Main.rand.Next(1, 2));
                        }
                        if (npc.type == NPCID.SlimedZombie)
                        {
                            if (Main.rand.Next(2) == 0)   //item rarity
                            {
                                Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("RustyMetal"), Main.rand.Next(1, 2));
                            }
                            if (npc.type == NPCID.SwampZombie)
                            {
                                if (Main.rand.Next(2) == 0)   //item rarity
                                {
                                    Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("RustyMetal"), Main.rand.Next(1, 2));
                                }
                                if (npc.type == NPCID.TwiggyZombie)
                                {
                                    if (Main.rand.Next(2) == 0)   //item rarity
                                    {
                                        Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("RustyMetal"), Main.rand.Next(1, 2));
                                    }
                                    if (npc.type == NPCID.FemaleZombie)
                                    {
                                        if (Main.rand.Next(2) == 0)   //item rarity
                                        {
                                            Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("RustyMetal"), Main.rand.Next(1, 2));
                                        }
                                    }
                                }
                            }
                        }
                    }    
                }
            }
        }
    }
}
 
Anyone know how to make it so that an enemy and its variants drop a custom item because i tried and only the original normal variant drops the item
Code:
using Microsoft.Xna.Framework;
using Terraria;
using Terraria.ID;
using Terraria.ModLoader;

namespace NicksMod.NPCs
{
    public class GlobalNPCs : GlobalNPC
    {
        public override void NPCLoot(NPC npc)
        {
            if (npc.type == NPCID.Zombie)
            {
                if (Main.rand.Next(2) == 0)   //item rarity
                {
                    Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("RustyMetal"), Main.rand.Next(1, 2));
                }
                if (npc.type == NPCID.BaldZombie)
                {
                    if (Main.rand.Next(2) == 0)   //item rarity
                    {
                        Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("RustyMetal"), Main.rand.Next(1, 2));
                    }
                    if (npc.type == NPCID.PincushionZombie)
                    {
                        if (Main.rand.Next(2) == 0)   //item rarity
                        {
                            Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("RustyMetal"), Main.rand.Next(1, 2));
                        }
                        if (npc.type == NPCID.SlimedZombie)
                        {
                            if (Main.rand.Next(2) == 0)   //item rarity
                            {
                                Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("RustyMetal"), Main.rand.Next(1, 2));
                            }
                            if (npc.type == NPCID.SwampZombie)
                            {
                                if (Main.rand.Next(2) == 0)   //item rarity
                                {
                                    Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("RustyMetal"), Main.rand.Next(1, 2));
                                }
                                if (npc.type == NPCID.TwiggyZombie)
                                {
                                    if (Main.rand.Next(2) == 0)   //item rarity
                                    {
                                        Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("RustyMetal"), Main.rand.Next(1, 2));
                                    }
                                    if (npc.type == NPCID.FemaleZombie)
                                    {
                                        if (Main.rand.Next(2) == 0)   //item rarity
                                        {
                                            Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("RustyMetal"), Main.rand.Next(1, 2));
                                        }
                                    }
                                }
                            }
                        }
                    }   
                }
            }
        }
    }
}
You don't see a problem with the nesting of these if statements? The inner code will never run because they are nested in other statements that contradict them.
 
how do i make when the projectile is on the screen you get a buff?

using System.Collections.Generic;
using System;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Graphics;
using Terraria;
using Terraria.ID;
using Terraria.ModLoader;

namespace something.Projectiles
{
public class projectilething : ModProjectile
{
public override void SetStaticDefaults()
{
DisplayName.SetDefault("projectile");
}
public override void SetDefaults()
{
projectile.scale = 1.0f;
projectile.width = 100;
projectile.height = 100;
projectile.penetrate = -1;
projectile.hostile = false;
projectile.friendly = true;
projectile.tileCollide = false;
projectile.ignoreWater = true;
projectile.alpha = 255;
projectile.timeLeft = 1;
projectile.melee = true;
}


}
}
 
I try to reload my mods and no matter what i try this happens, even with other mods but with other files. for example in calamity it says "Flaresound.wav"

The wav sound file at Sounds/Custom/Castanet.wav failed to load
at Terraria.ModLoader.Mod.Autoload()
at Terraria.ModLoader.ModLoader.do_Load(Object threadContext)

Inner Exception:
External component has thrown an exception.
at Microsoft.Xna.Framework.Audio.SoundEffect.AllocateFormatAndData(Byte[] format, Byte[] data, Int32 offset, Int32 count)
at Microsoft.Xna.Framework.Audio.SoundEffect..ctor(Stream stream)
at Microsoft.Xna.Framework.Audio.SoundEffect.FromStream(Stream stream)
at Terraria.ModLoader.Mod.Autoload()

I would appreciate help fixing this as soon as possible.
 
I try to reload my mods and no matter what i try this happens, even with other mods but with other files. for example in calamity it says "Flaresound.wav"

The wav sound file at Sounds/Custom/Castanet.wav failed to load
at Terraria.ModLoader.Mod.Autoload()
at Terraria.ModLoader.ModLoader.do_Load(Object threadContext)

Inner Exception:
External component has thrown an exception.
at Microsoft.Xna.Framework.Audio.SoundEffect.AllocateFormatAndData(Byte[] format, Byte[] data, Int32 offset, Int32 count)
at Microsoft.Xna.Framework.Audio.SoundEffect..ctor(Stream stream)
at Microsoft.Xna.Framework.Audio.SoundEffect.FromStream(Stream stream)
at Terraria.ModLoader.Mod.Autoload()

I would appreciate help fixing this as soon as possible.
I've seen this happen when users don't have speakers.
 
Hey Im trying to get an equipment to dash like the master ninja gear, among other things. when I double click either A or D it does nothing. my code is

using System;
using Microsoft.Xna.Framework;
using Terraria;
using Terraria.ID;
using Terraria.ModLoader;

namespace MasksAndMore.Items
{
public class NinjaMask : ModItem
{
public override void SetStaticDefaults()
{
DisplayName.SetDefault("Ninja Mask");
Tooltip.SetDefault("A mask worn by trained ninjas. How did you get this?");
}
public override void SetDefaults()
{
item.width = 40;
item.height = 40;
item.maxStack = 99;
item.value = 120000;
item.rare = 9;
item.accessory = true;
}

public override void AddRecipes()
{
ModRecipe recipe = new ModRecipe(mod);
recipe.AddIngredient(ItemID.MasterNinjaGear, 1);
recipe.AddIngredient(ItemID.EoCShield, 1);
recipe.AddIngredient(ItemID.NinjaHood, 1);
recipe.AddIngredient(ItemID.NinjaShirt, 1);
recipe.AddIngredient(ItemID.NinjaPants, 1);
recipe.AddIngredient(null, "MaskTemplate", 1);
recipe.AddTile(null, "MaskTable");
recipe.SetResult(this);
recipe.AddRecipe();
}

public override void UpdateAccessory(Player player, bool hideVisual)
{
player.thrownDamage += 0.20f;
player.spikedBoots += 2;
player.dash = 4;
ExamplePlayer modplayer = (ExamplePlayer)(player.GetModPlayer(mod, "ExamplePlayer"));
modplayer.ninjaMaskPet = true;
modplayer.NinjaDodge = true;
}
}
}
 
Back
Top Bottom