• For issues you find with the Switch and Console releases, please follow this link and give as much detail as possible. This is the speediest way to get info to Pipeworks and get a hotfix in the works.
  • 1.4 will bring many changes to the PC version. We strongly advise making plans to back up your worlds and players prior to updating your game. More details here.
  • Begin your search for Journey's End information here and here. Please report bugs and issues for Journey's End here.
  • For issues you find with the Mobile 1.3 update, please follow this link and give as much detail as possible. This is the speediest way to get info to DR Studios to look at your issue. Also, some troubleshooting hints here.

Standalone [1.3] tModLoader - A Modding API

Solo-Ion

Dungeon Spirit
How do I get my projectile to do damage? This question sounds dumb but since this projectile (Poison Ring) spawns from the (Poison Spell) it doesn't do any damage.
here is the projectile's code (Poison Ring)
Code:
using System;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Graphics;
using Terraria;
using Terraria.ID;
using Terraria.ModLoader;

namespace EpicnessModRemastered.Projectiles
{
    public class PoisonRing : ModProjectile
    {  
        public override void SetDefaults()
        {
            projectile.name = "Poison Ring";
            projectile.width = 160;
            projectile.height = 159;
            projectile.friendly = true;
            projectile.hostile = false;
            projectile.ranged = false;
            projectile.melee = false;
            projectile.magic = true;
            projectile.penetrate = -1;
            projectile.timeLeft = 600;
            projectile.light = 0.5f;
            projectile.tileCollide = false;
            projectile.extraUpdates = 1;
            ProjectileID.Sets.TrailCacheLength[projectile.type] = 5;
            ProjectileID.Sets.TrailingMode[projectile.type] = 0;
        }
        public override bool PreAI()
    {
        projectile.velocity = Vector2.Zero;
        return false;
    }

    }
}
I believe all you are missing is projectile.damage = (some number); from your SetDefaults hook.
 

dtim

Terrarian
All of my Characters and worlds disappeared after downloading. Any help on recuperating them?
Go to "My Documents\My Games\Terraria\" Copy the "Worlds" and "Players" folders into the "ModLoader" folder. Just be careful about overwriting files, etc.
 

Unit One

Administrator
Staff member
Administrator

Noctus

Terrarian
Who knows what is the name of mod, which the more information about weapon
Example:
Wood sword
7 Melee Damage
Very Fast speed (25)
Weak knockback (4)
 
Last edited:

mutater

Spazmatism
I want to make an accessory that takes away invulnerability frames, and also takes away life regen, how would I do that? I have no idea where to find a list with all of the player's stat names e.g. meleeDamage

*player.meleeDamage*
 

Dragonpriest4

Skeletron Prime
I believe all you are missing is projectile.damage = (some number); from your SetDefaults hook.
I added the projectile.damage = 25; but it still doesn't do damage :/
Here is the code:
Code:
using System;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Graphics;
using Terraria;
using Terraria.ID;
using Terraria.ModLoader;

namespace EpicnessModRemastered.Projectiles
{
    public class PoisonRing : ModProjectile
    {   
        public override void SetDefaults()
        {
            projectile.name = "Poison Ring";
            projectile.width = 160;
            projectile.height = 159;
            projectile.friendly = true;
            projectile.magic = true;
            projectile.penetrate = -1;
            projectile.timeLeft = 600;
            projectile.light = 0.5f;
            projectile.tileCollide = false;
            projectile.extraUpdates = 1;
            ProjectileID.Sets.TrailCacheLength[projectile.type] = 5;
            ProjectileID.Sets.TrailingMode[projectile.type] = 0;
            projectile.damage = 25;
        }
        public override bool PreAI()
        {
            projectile.velocity = Vector2.Zero;
            return false;
        }

    }
}
 

FARemy

Steampunker
I added the projectile.damage = 25; but it still doesn't do damage :/
Here is the code:
Code:
using System;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Graphics;
using Terraria;
using Terraria.ID;
using Terraria.ModLoader;

namespace EpicnessModRemastered.Projectiles
{
    public class PoisonRing : ModProjectile
    {  
        public override void SetDefaults()
        {
            projectile.name = "Poison Ring";
            projectile.width = 160;
            projectile.height = 159;
            projectile.friendly = true;
            projectile.magic = true;
            projectile.penetrate = -1;
            projectile.timeLeft = 600;
            projectile.light = 0.5f;
            projectile.tileCollide = false;
            projectile.extraUpdates = 1;
            ProjectileID.Sets.TrailCacheLength[projectile.type] = 5;
            ProjectileID.Sets.TrailingMode[projectile.type] = 0;
            projectile.damage = 25;
        }
        public override bool PreAI()
        {
            projectile.velocity = Vector2.Zero;
            return false;
        }

    }
}
If you ever put the item.damage in your SetDefaults hook for your items, it should do the weapons' damage
[doublepost=1486234608,1486234348][/doublepost]On my side, I have another problem. I'm making a spear, and it's noice and stuff, but even though it goes in the right direstion, it points in the most random way ever...
Here is my code for the item and the projectile :
Code:
using Terraria;
using Terraria.ID;
using Terraria.ModLoader;

namespace SimpleMod.Items
{
    public class SimpleSpear : ModItem
    {
        public override void SetDefaults()
        {
            item.name = "Simple Spear";
            item.width = 80;
            item.height = 80;
            item.toolTip = "A simple spear...";
            item.rare = 2;
            item.useTime = 60;
            item.useAnimation = 60;
            item.useStyle = 5;
            item.useTurn = true;
            item.autoReuse = true;
            item.UseSound = SoundID.Item1;
            item.value = 10000;
            item.damage = 60;
            item.knockBack = 8f;
            item.crit = 4;
            item.shoot = mod.ProjectileType("SimpleSpearProj");
            item.shootSpeed = 3f;
            item.melee = true;
            item.noMelee = true;
            item.noUseGraphic = true;
        }
       
        public override bool CanUseItem(Player player)
        {
            return player.ownedProjectileCounts[item.shoot] < 1;
        }
       
        public override void AddRecipes()
        {
            ModRecipe recipe;
           
            recipe = new ModRecipe(mod);
            recipe.AddIngredient(null, "SimpleAlloy", 10);
            recipe.AddTile(TileID.Anvils);
            recipe.SetResult(this);
            recipe.AddRecipe();
        }
    }
}
Code:
using System;
using Microsoft.Xna.Framework;
using Terraria;
using Terraria.ModLoader;

namespace SimpleMod.Projectiles
{
    public class SimpleSpearProj : ModProjectile
    {
        public override void SetDefaults()
        {
            projectile.name = "Simple Spear";
            projectile.width = 80;
            projectile.height = 80;
            projectile.aiStyle = 19;
            projectile.penetrate = -1;
            projectile.friendly = true;
            projectile.hide = true;
            projectile.ignoreWater = true;
            projectile.tileCollide = false;
            projectile.melee = true;
            projectile.ownerHitCheck = true;
        }
       
        public override void AI()
        {
            Main.player[projectile.owner].direction = projectile.direction;
            Main.player[projectile.owner].heldProj = projectile.whoAmI;
            Main.player[projectile.owner].itemTime = Main.player[projectile.owner].itemAnimation;
            projectile.position.X = Main.player[projectile.owner].position.X + (float)(Main.player[projectile.owner].width / 2) - (float)(projectile.width / 2);
            projectile.position.Y = Main.player[projectile.owner].position.Y + (float)(Main.player[projectile.owner].height / 2) - (float)(projectile.height / 2);
            projectile.position += projectile.velocity * projectile.ai[0];
           
            if (!Main.player[projectile.owner].frozen)
            {
                if (projectile.ai[0] == 0f)
                {
                    projectile.ai[0] = 3f;
                    projectile.netUpdate = true;
                }
               
                if (Main.player[projectile.owner].itemAnimation < Main.player[projectile.owner].itemAnimationMax / 3)
                {
                    projectile.ai[0] -= 1f;
                }
                else
                {
                    projectile.ai[0] += 1f;
                }
            }
           
            if (Main.player[projectile.owner].itemAnimation == 0)
            {
                projectile.Kill();
            }
           
            projectile.rotation = (float)Math.Atan2((double)projectile.velocity.X, (double)projectile.velocity.Y) + MathHelper.ToRadians(135f);
            if (projectile.spriteDirection == -1)
            {
                projectile.rotation -= MathHelper.ToRadians(90f);
            }
        }
    }
}

Thx for anyone who will help me :p
 

dtim

Terrarian
I want to make an accessory that takes away invulnerability frames, and also takes away life regen, how would I do that? I have no idea where to find a list with all of the player's stat names e.g. meleeDamage

*player.meleeDamage*
To take away regen, in ModPlayer.UpdateBadLifeRegen put lines like "player.lifeRegen = 0; player.lifeRegenTime = 0;"
For the invulnerability, if you use ModPlayer.PostHurt and have "player.immuneTime = 0;" it would get rid of most of it I think.

If doing this via an accessory, you'll need to set some kind of flag in the ModPlayer class.
[doublepost=1486237047,1486236549][/doublepost]
<snippage>
Code:
            projectile.rotation = (float)Math.Atan2((double)projectile.velocity.X, (double)projectile.velocity.Y) + MathHelper.ToRadians(135f);
            if (projectile.spriteDirection == -1)
            {
                projectile.rotation -= MathHelper.ToRadians(90f);
            }
        }
    }
}

Thx for anyone who will help me :p
Math.Atan2 parameters should be Y and then X. I'm not sure if you'll need to adjust it with the MathHelper stuff after that or not.
 

FARemy

Steampunker
To take away regen, in ModPlayer.UpdateBadLifeRegen put lines like "player.lifeRegen = 0; player.lifeRegenTime = 0;"
For the invulnerability, if you use ModPlayer.PostHurt and have "player.immuneTime = 0;" it would get rid of most of it I think.

If doing this via an accessory, you'll need to set some kind of flag in the ModPlayer class.
[doublepost=1486237047,1486236549][/doublepost]

Math.Atan2 parameters should be Y and then X. I'm not sure if you'll need to adjust it with the MathHelper stuff after that or not.
Ooooh... Now it works ! Thx a lot
 

Zyv

Terrarian
Hi there, so I've been using TmodLoader for quite some time. I've always this and using mods has always made the experience much more fun than vanilla. However I have an issue. This morning I wanted to play some Terraria and all that so I loaded it up just like usual and it asked me for a language. I thought this was a little strange because that usually only happens the first time you're opening Terraria right? Well I didn't think much of it so I clicked English as usual and went to single player. Once it loaded up all of my characters were gone. As well are all of my worlds. This made me pretty frustrated because I've spent countless hours in some of those worlds making some pretty large builds (One of which took me 20+ hours while using Cheat Sheet to give myself the blocks and wings). After sitting there in awe I decided I would just go to my mods and choose whichever ones I wanted and I would start over. But in the mods section I have no mods installed. I thought this was weird but again I didn't think much of it. I went to go reinstall them and there is literally nothing in the mod browser. I tried changing the buttons at the top left and reinstalling TModLoader and even reinstalling Terraria and still nothing at all. Help?
 

Solo-Ion

Dungeon Spirit
@Dragonpriest4 My bad, I forgot that projectiles inherit their damage from the item that shoots them. Thanks, @FARemy

Hi there, so I've been using TmodLoader for quite some time. I've always this and using mods has always made the experience much more fun than vanilla. However I have an issue. This morning I wanted to play some Terraria and all that so I loaded it up just like usual and it asked me for a language. I thought this was a little strange because that usually only happens the first time you're opening Terraria right? Well I didn't think much of it so I clicked English as usual and went to single player. Once it loaded up all of my characters were gone. As well are all of my worlds. This made me pretty frustrated because I've spent countless hours in some of those worlds making some pretty large builds (One of which took me 20+ hours while using Cheat Sheet to give myself the blocks and wings). After sitting there in awe I decided I would just go to my mods and choose whichever ones I wanted and I would start over. But in the mods section I have no mods installed. I thought this was weird but again I didn't think much of it. I went to go reinstall them and there is literally nothing in the mod browser. I tried changing the buttons at the top left and reinstalling TModLoader and even reinstalling Terraria and still nothing at all. Help?
Have you located the folder '...My Documents/My Games/Terraria/ModLoader'? That's where your mods, settings, worlds and players are stored. If it was deleted, it would explain why tModLoader has been reset. Maybe have a look in your recycle bin to see if it's there.
 

PetitPain

Terrarian
I have the same problem as TheGamingPicDoesGaming : The Mod Browser doesn't work, it doesn't show any mod to install even if I change filters
 
Top Bottom