Eldrazi
Eater of Worlds
Problem is: animations for projectiles and NPCs (which I think you refer to as monsters) are both handled differently.can you help with the animation please?
The ModNPC class has an overridable function:
Code:
public override void FindFrame(int frameHeight)
{
}
Also, don't forget to set Main.npcFrameCount[npc.type] to the correct amount of frames in the SetDefaults method of your NPC.
Now for ModProjectiles you'll want to integrate the animating into the AI. Set Main.projFrames[projectile.type] to the correct amount of animation frames in your SetDefaults method and repeat the same process as with the NPC, but inside the PreAI, AI of PostAI function. Also, you can just set projectile.frame to the current frame ID (since we don't have frameHeight of some sorts).
Randomly teleporting an NPC falls under AI, and I do recommend you to try and make that yourself (using Terraria's source preferably).