public override void SetDefaults()
{
npc.CloneDefaults(NPCID.DiggerHead);
npc.width = 105;
npc.height = 123;
npc.aiStyle = -1;
npc.boss = true;
npc.lifeMax = 30000;
npc.damage = 100;
npc.defense = 25;
npc.lavaImmune = true;
music = mod.GetSoundSlot(SoundType.Music, "Sounds/Music/Boss1");
bossBag = mod.ItemType("ReaverBag");
npc.value = Item.buyPrice(0, 1, 75, 0);
}
How to use Custom texture? i am new in tModLoader.The ExampleMod is open source on github and even has a modded worm enemy. I highly reccommend using it and it's worked quite well for my boss, the Chaos Reaver. Make most of your changes to your head, like your music, boss tag, etc, this is what my worm head defaults looks like :
Code:public override void SetDefaults() { npc.CloneDefaults(NPCID.DiggerHead); npc.width = 105; npc.height = 123; npc.aiStyle = -1; npc.boss = true; npc.lifeMax = 30000; npc.damage = 100; npc.defense = 25; npc.lavaImmune = true; music = mod.GetSoundSlot(SoundType.Music, "Sounds/Music/Boss1"); bossBag = mod.ItemType("ReaverBag"); npc.value = Item.buyPrice(0, 1, 75, 0); }
I wouldn't recommend trying to create a worm style NPC if you are new to tModLoader- especially using a tutorial as old as this, which I had to modify quite a bit to make it work with today's methods; although if you feel like you are ready for something a bit more advanced, go ahead and try it out!How to use Custom texture? i am new in tModLoader.
Thank you so much.I wouldn't recommend trying to create a worm style NPC if you are new to tModLoader- especially using a tutorial as old as this, which I had to modify quite a bit to make it work with today's methods; although if you feel like you are ready for something a bit more advanced, go ahead and try it out!
That being said, I would recommend downloading a good, safe vanilla Terraria spritesheet pack.
They may seem like a bit much to handle at the start, but it is very very useful for creating your own animated sprites and for recognizing what AI and animation bases to use.
For instance, all worm type NPCs use three custom textures with one for the head, one for the body and one for the tail.
They are called in the individual internal classes ExampleWormHead ExampleWormBody and ExampleWormTail. These internal classes are essentially just a way of putting all three individual worm segments (head, body, tail) inside of one file to make organization easier.
Also keep in mind that in order to use the custom textures for head body and tail, the class names ExampleWormHead ExampleWormBody and ExampleWormTail must match the names of the textures. So do the names on lines 91, 92 and 93.
You will also need to remove the lines that say
public override string Texture => "Terraria/NPC_" + NPCID.DiggerHead;
at the beginning of each ExampleWorm internal class, as these are just placeholders that use the preexisting Terraria texture for the Digger.
Note: completely remove these lines to use your custom textures instead of trying to modify them.
I know this is a bit late to post something like this, but I hope that it can be useful for other users
How im got ai worm?No problem, I'm pretty inexperienced myself, my only other coding experience was with minecraft and roblox lol, but if you have any other questions im here to help