Standalone [1.3] tModLoader - A Modding API

For some reason my code here is casuing some issues.
Code:
using System;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Graphics;
using Terraria;
using Terraria.ID;
using Terraria.ModLoader;

namespace SpiritMod.Items.Shuriken
{
    public class TundraTridentProjectile : ModProjectile
    {
        public override void SetDefaults()
        {

            projectile.name = "Tundra Trident";
            projectile.width = 18;
            projectile.height = 70;
            projectile.aiStyle = 113;
            projectile.friendly = true;
            projectile.thrown = true;
            projectile.tileCollide = true;
            projectile.penetrate = -1;
            projectile.timeLeft = 1000;
            projectile.alpha = 255;
            projectile.extraUpdates = 1;
            projectile.light = 0;
            ProjectileID.Sets.TrailCacheLength[projectile.type] = 9;
            ProjectileID.Sets.TrailingMode[projectile.type] = 0;
            aiType = ProjectileID.BoneJavelin;

        }

        public override void OnHitNPC(NPC target, int damage, float knockback, bool crit)
        {
            if (Main.rand.Next(0) == 0)
            {
                target.AddBuff(mod.BuffType("DeepFreeze"), 120, true);
            }
        }

        //public override bool PreDraw(SpriteBatch spriteBatch, Color lightColor)
        //{
        //    Vector2 drawOrigin = new Vector2(Main.projectileTexture[projectile.type].Width * 0.5f, projectile.height * 0.5f);
        //    for (int k = 0; k < projectile.oldPos.Length; k++)
        //    {
        //        Vector2 drawPos = projectile.oldPos[k] - Main.screenPosition + drawOrigin + new Vector2(0f, projectile.gfxOffY);
        //        Color color = projectile.GetAlpha(lightColor) * ((float)(projectile.oldPos.Length - k) / (float)projectile.oldPos.Length);
        //        spriteBatch.Draw(Main.projectileTexture[projectile.type], drawPos, null, color, projectile.rotation, drawOrigin, projectile.scale, SpriteEffects.None, 0f);
        //    }
        //    return true;
        //}
    }
}
^Projectile
Code:
using System;
using Terraria;
using Terraria.ID;
using Terraria.ModLoader;

namespace SpiritMod.Items.Shuriken
{
    public class TundraTrident : ModItem
    {
        public override void SetDefaults()
        {
            item.CloneDefaults(ItemID.BoneJavelin);
            item.name = "Tundra Trident";
            item.useStyle = 1;
            item.width = 18;
            item.height = 70;
            item.noUseGraphic = true;
            item.useSound = 1;
            item.thrown = true;
            item.channel = true;
            item.noMelee = true;
            item.consumable = true;
            item.maxStack = 999;
            item.shoot = mod.ProjectileType("TundraTridentProjectile");
            item.toolTip = "Inflicts Deep Freeze";
            item.useAnimation = 25;
            item.useTime = 19;
            item.shootSpeed = 11.5f;
            item.damage = 85;
            item.knockBack = 5.5f;
            item.value = Item.sellPrice(0, 0, 20, 20);
            item.crit = 10;
            item.rare = 5;
            item.autoReuse = true;
        }
    }
}
^ Item

For some reason I cannot shoot side to side or downwards (most likely because the spear is hitting the ground automtatically, even though the hitbox is exact)
and it shoots 3 at a time. here is the spirte in case you think that might be the reason.
TundraTrident.png
 
Hmm. In the thread, it says "Do not use tModLoader to do anything that breaks the Terraria Forums rules." Does this mean that people are not allowed to make mods that bring back previously removed items like the zapinator?
 
Is thorium mod compatible with tmodloader 0.8.1? Because my terraria system says it is
If so, when will the new update be released? I want to play thorium but also using tmodloader
 
Is thorium mod compatible with tmodloader 0.8.1? Because my terraria system says it is
If so, when will the new update be released? I want to play thorium but also using tmodloader
Please ask this in Thorium's mod thread.
Also, yes, it is compatible, so have fun!
 
Is thorium mod compatible with tmodloader 0.8.1? Because my terraria system says it is
If so, when will the new update be released? I want to play thorium but also using tmodloader
I meant to say that "Because my terraria system says it isn't"
Sorry about that, asked in other forum
 
Just some news, I've been on vacation over the weekend so I didn't get any work done. That's also a big reason I released the windows update ahead of time, so people wouldn't have to wait the entire weekend; I knew there was something I was forgetting to say.

this has probably been answered, but front page doesnt really say...
But! has the npcs/monsters disappearing been fixed with servers?
We don't know yet, since none of the developers have that bug.

Does anyone know how to make a walking a pet, like a rabbit? Or it is impossible at current tml stage?
It's been possible for a long time, but it will require some pretty intensive programming.

I think this could be a bug:

NearbyEffects is called whenever a player is near a tile, but in MP, it is only called in the Client-Side, not in Server-Side

Is it a bug?
It's not a bug. NearbyEffects only makes sense in the context of the players themselves, and the players are controlled by the clients. It's the same reason that the fireplace and music boxes only have effects client-side.

How do I make an NPC/Player get a really dark blue tint when a buff is active?
https://github.com/bluemagic123/tMo...l-void-draweffectsnpc-npc-ref-color-drawcolor
https://github.com/bluemagic123/tMo...g-ref-float-b-ref-float-a-ref-bool-fullbright
 
my game keeps crashing when i try to make a new character
[doublepost=1464584683,1464584602][/doublepost]oops, just a first time error sorry if i wasted your time, nice work on the update to 1.3.1 terraria mod loader, i can play thorium again!
 
Can someone help me, Terraria works perfectly but when i use tModLoader everything is perfect except when i walk on anything its super laggy, and when i fly in the air or jump the game becomes really smoothly again or if i stand still

Did i ruined my files?.. I even re-installed everything but i get the same problem sadly enough

Here is a video link if you need to see it with your eyes, on video it's way less laggy for some reason but here you go:


P.S = Who found the solution to fix this gets a cookie

just kidding. you are awesome if you helped me



 
Last edited:
Back
Top Bottom