Standalone [1.3] tModLoader - A Modding API

How do I switch between Vanilla Terraria and tMod? I'm not wanting to play with the tMod all the time and I'd rather not delete, rename, move, etc, files every time I want to switch.
 
Has servers been implemented?
Servers have been implemented, just there are some problems and Bluemagic is patching it up soon.
How do I switch between Vanilla Terraria and tMod? I'm not wanting to play with the tMod all the time and I'd rather not delete, rename, move, etc, files every time I want to switch.
There should be something like Terraria.bak.exe, rename that to Terraria.exe and it should work as vanilla Terraria if I recall correctly.
 
Servers have been implemented, just there are some problems and Bluemagic is patching it up soon.

There should be something like Terraria.bak.exe, rename that to Terraria.exe and it should work as vanilla Terraria if I recall correctly.
Well, I have a little experience with servers. I hope I could host a server for my beta testers.
 
Servers have been implemented, just there are some problems and Bluemagic is patching it up soon.

There should be something like Terraria.bak.exe, rename that to Terraria.exe and it should work as vanilla Terraria if I recall correctly.
I remember that file from the past, but no such thing exists in my install folder of Terraria. None the less, I should figure it out eventually on how to jump back and forth without doing to much.
 
I remember that file from the past, but no such thing exists in my install folder of Terraria. None the less, I should figure it out eventually on how to jump back and forth without doing to much.
Do you have a file called Terraria_v1.3.0.8.exe?
 
Hey guys!
So I'm trying to make a projectile spawn more projectiles on death, but when the projectile is "killed" nothing happens. Here is my script so far, and as you can probably tell I'm a massive C# scrub.
public override void Kill(int timeLeft)
{
for (int k = 0; k < 5; k++)
{
Dust.NewDust(projectile.position + projectile.velocity, projectile.width, projectile.height, mod.DustType("EtherealFlame"), projectile.oldVelocity.X * 0.5f, projectile.oldVelocity.Y * 0.5f);
}
Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 25);
Projectile.NewProjectile((int)projectile.position.X + 1, (int)projectile.position.Y, 5, 5, mod.ItemType("DeathOrb"), 10, 0.5f);
Projectile.NewProjectile((int)projectile.position.X - 1, (int)projectile.position.Y, -5, 5, mod.ItemType("DeathOrb"), 10, 0.5f);
}

Any help is appreciated!
Thanks, Tulra
 
Last edited:
I tested a lot my mod and I thought I had done something wrong but I found a bug in tmodloader while doing my tests.

public override void NPCLoot(NPC npc) is not called when an npc die in a server in multiplayer game.

So what I tried to be sure: My mod give xp. But on multiplayer it does not. But leech worked since it's on hit. So I tried calling the npcloot on each hit and it worked. So by the mean the hook is not called on a multiplayer game. But it is in single player.
 
Hey guys!
So I'm trying to make a projectile spawn more projectiles on death, but when the projectile is "killed" nothing happens. Here is my script so far, and as you can probably tell I'm a massive C# scrub.
public override void Kill(int timeLeft)
{
for (int k = 0; k < 5; k++)
{
Dust.NewDust(projectile.position + projectile.velocity, projectile.width, projectile.height, mod.DustType("EtherealFlame"), projectile.oldVelocity.X * 0.5f, projectile.oldVelocity.Y * 0.5f);
}
Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 25);
Projectile.NewProjectile((int)projectile.position.X + 1, (int)projectile.position.Y, 5, 5, mod.ItemType("DeathOrb"), 10, 0.5f);
Projectile.NewProjectile((int)projectile.position.X - 1, (int)projectile.position.Y, -5, 5, mod.ItemType("DeathOrb"), 10, 0.5f);
}

Any help is appreciated!
Thanks, Tulra
You should probably do mod.ProjectileType() instead of mod.ItemType(). You don't really need the int for projectile.position. And that's pretty much all.
 
You should probably do mod.ProjectileType() instead of mod.ItemType(). You don't really need the int for projectile.position. And that's pretty much all.

Thanks so much for the help before, I have another probably scrub issue.
The projectile now splits into the new projectiles which behave as normal, except they deal no damage, apply no knockback and generally act as if they aren't colliding with NPCs.

Code:
        public override void Kill(int timeLeft)
        {
            for (int k = 0; k < 5; k++)
            {
                Dust.NewDust(projectile.position + projectile.velocity, projectile.width, projectile.height, mod.DustType("EtherealFlame"), projectile.oldVelocity.X * 0.5f, projectile.oldVelocity.Y * 0.5f);
            }
            Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 25);
            Projectile.NewProjectile(projectile.position.X + 1, projectile.position.Y, projectile.velocity.X * 1.25f, projectile.velocity.Y, mod.ProjectileType("DeathOrb"), 10, 0.5f);
            Projectile.NewProjectile(projectile.position.X - 1, projectile.position.Y, projectile.velocity.X * 0.75f, projectile.velocity.Y, mod.ProjectileType("DeathOrb"), 10, 0.5f);
        }

Sorry for noobing it up once again, but I would really like to learn how to mod Terraria as an introduction to coding. Thanks!
 
Thanks so much for the help before, I have another probably scrub issue.
The projectile now splits into the new projectiles which behave as normal, except they deal no damage, apply no knockback and generally act as if they aren't colliding with NPCs.

Code:
        public override void Kill(int timeLeft)
        {
            for (int k = 0; k < 5; k++)
            {
                Dust.NewDust(projectile.position + projectile.velocity, projectile.width, projectile.height, mod.DustType("EtherealFlame"), projectile.oldVelocity.X * 0.5f, projectile.oldVelocity.Y * 0.5f);
            }
            Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 25);
            Projectile.NewProjectile(projectile.position.X + 1, projectile.position.Y, projectile.velocity.X * 1.25f, projectile.velocity.Y, mod.ProjectileType("DeathOrb"), 10, 0.5f);
            Projectile.NewProjectile(projectile.position.X - 1, projectile.position.Y, projectile.velocity.X * 0.75f, projectile.velocity.Y, mod.ProjectileType("DeathOrb"), 10, 0.5f);
        }

Sorry for noobing it up once again, but I would really like to learn how to mod Terraria as an introduction to coding. Thanks!
In the Projectile.NewProjectile function, you want to insert one more parameter:
Code:
Projectile.NewProjectile(projectile.position.X + 1, projectile.position.Y, projectile.velocity.X * 1.25f, projectile.velocity.Y, mod.ProjectileType("DeathOrb"), 10, 0.5f, Main.player[Main.myPlayer]);
That should probably work.
 
In the Projectile.NewProjectile function, you want to insert one more parameter:
Code:
Projectile.NewProjectile(projectile.position.X + 1, projectile.position.Y, projectile.velocity.X * 1.25f, projectile.velocity.Y, mod.ProjectileType("DeathOrb"), 10, 0.5f, Main.player[Main.myPlayer]);
That should probably work.
That exact code didn't work, but if you take away the Main.player before the square brackets, it works. Thanks so much!
 
I have a problem that one day, all of my worlds got corrupted and I can't even enter new worlds when I create them,Is this a bug? Because I can't even access new worlds
 
Back
Top Bottom