Standalone [1.3] tModLoader - A Modding API

I've rewritten the drop code a bit. Now the type of the NPC is only checked once (which is neater if you ask me).
Also, we can now return false when the NPC is actually the Golem, since we want to stop the Golems vanilla loot from spawning (right?).
Code:
public override bool PreNPCLoot(NPC npc)
{
    if(npc.type == 245)
    {
        int rand = Main.rand.Next(0, 9);
      
        if (rand == 0)
        {
            Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, 1258);
            Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, 1261, Main.rand.Next(60, 100));
        }
        else if (rand == 1)
            Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, 1122);
        else if (rand == 2)
            Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, 8899);
        else if (rand == 3)
            Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, 1248);
        else if (rand == 4)
            Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, 1294);
        else if (rand == 5)
            Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, 1295);
        else if (rand == 6)
            Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, 1296);
        else if (rand == 7)
            Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, 1297);
        else if (rand == 8)
            Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("OneRing"));  // Etc etc, untill you reach 8, where you drop your own item.
          
        return false;
    }
    return true;
}
thanks :D
 
Every version i install i keep getting an error , smth like " side by side configuration is incorect" . I researched about this and i tried reinstall my visual studio, runtimes, c++ EVERYTING , but nothing....pls help!! I want to play tremor :)
 

Attachments

  • terarria.png
    terarria.png
    98.6 KB · Views: 189
That's because the vanilla Clemtaminator uses bullets, right? Bullets are items and they override the type of projectile the weapon shoots.
Now since this weapon only uses mana and no bullets, it will always shoot the same projectile: Pure Spray, which (according to the source code) doesn't have any particles.
so here's an idea, can i make it shoot two projectiles, like, add in a second projectile that is just particles, and give it the same momentum and such?
if so, can you tell me how to add a projectile but not remove the previous one?
 
so here's an idea, can i make it shoot two projectiles, like, add in a second projectile that is just particles, and give it the same momentum and such?
if so, can you tell me how to add a projectile but not remove the previous one?
Do you want your Clentaminator clone to only shoot one type of projectile?
 
so here's an idea, can i make it shoot two projectiles, like, add in a second projectile that is just particles, and give it the same momentum and such?
if so, can you tell me how to add a projectile but not remove the previous one?
If you want your new item to shoot the original projectile along with an additional one, you could add your projectile in the override function
Code:
public override bool Shoot(Player player, ref Vector2 position, ref float speedX, ref float speedY, ref int type, ref int damage, ref float knockBack)
and return true so it also fires the original projectile
 
so here's an idea, can i make it shoot two projectiles, like, add in a second projectile that is just particles, and give it the same momentum and such?
if so, can you tell me how to add a projectile but not remove the previous one?
i want it to shoot it original projectile that converts blocks, but i want another projectile from my mod named "ParticleProj" fired at the same time, in the same location with the same speed
 
i want it to shoot it original projectile that converts blocks, but i want another projectile from my mod named "ParticleProj" fired at the same time, in the same location with the same speed
Then you can use what @Dr. Frankenstein mentioned. Ex:
Code:
public override bool Shoot(Player player, ref Vector2 position, ref float speedX, ref float speedY, ref int type, ref int damage, ref float knockBack)
{
    Projectile.NewProjectile(position.X, position.Y, speedX, speedY, mod.ProjectileType("ParticleProj"), damage, knockBack, player.whoAmI);
    return true;
}
 
Then you can use what @Dr. Frankenstein mentioned. Ex:
Code:
public override bool Shoot(Player player, ref Vector2 position, ref float speedX, ref float speedY, ref int type, ref int damage, ref float knockBack)
{
    Projectile.NewProjectile(position.X, position.Y, speedX, speedY, mod.ProjectileType("ParticleProj"), damage, knockBack, player.whoAmI);
    return true;
}
Thanks again, and thank you @Dr. Frankenstein
 
Why does installing tModLoader give you an extra Terraria 1.3.1 version instead of 1.3.1.1?
Huh? On the bottom-left of my screen, there's the Terraria version (v1.3.1.1) above the tModLoader version (v0.8.1.2).
Are you saying that, for whatever reason, you have the Terraria version on top of another Terraria version?
 
I have found a few server bugs just today

1. The goblin invasion progress bar is glitched out and does not go up.
2. There are no money drops from mobs
3. In the case of the group play that me and my friends are doing. The goblin army was glitched and did not end, we had to shut down the server and the host had to kill them in singleplayer.



This is all on multiplayer on an expert mode world.
Both of those work perfectly fine for me on an expert server. The problem must be one of the mods you're using.

Why does installing tModLoader give you an extra Terraria 1.3.1 version instead of 1.3.1.1?
Woops, looks like I forgot to update the name for the vanilla backup. This will be fixed in the next update.
 
Hey @bluemagic123 (or anyone else willing to answer), is there a method in ModPlayer or otherwise that activates before the layers are drawn, but after Main.playerDrawData is populated? Essentially, I want to be able to do some last-second editing of the draw data before the player is actually drawn, such as changing the color or applying a shader.
 
Last edited:
Hey @bluemagic123 (or anyone else willing to answer), is there a method in ModPlayer or otherwise that activates before the layers are drawn, but after Main.playerDrawData is populated? Essentially, I want to be able to do some last-second editing of the draw data before the player is actually drawn, such as changing the color or applying a shader.
Someone can correct me if I'm wrong, but I think
Code:
public virtual void DrawEffects(PlayerDrawInfo drawInfo, ref float r, ref float g, ref float b, ref float a, ref bool fullBright)
is what you're looking for. The tModloader wiki says, "Allows you to create special effects when this player is drawn, such as creating dust, modifying the color the player is drawn in, etc..."
 
Back
Top Bottom