Boss texture not working.

Draymien

Skeletron Prime
(Idk if im using the correct thread thing, I hope so)
I would like to start off by telling you that you are about to see the worst code that your eyes have been forced to appreciate.
Anyway, so ill just get to the point, I am trying to make a boss with 6 frames, But it is only showing the first frame, Yeah I really don't know how to explain it. ill just give you my code and stuff
C#:
using System;
using Microsoft.Xna.Framework;
using Terraria;
using MasterPiece;
using MasterPiece.Dusts;
using MasterPiece.Projectiles;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Graphics;
using System;
using System.IO;
using Terraria;
using Terraria.ID;
using Terraria.ModLoader;
using static Terraria.ModLoader.ModContent;

namespace MasterPiece.NPCs.MechanicalBeast
{
    [AutoloadBossHead]
    public class MechanicalBeast : ModNPC
    {
        public override void SetStaticDefaults()
        {
            DisplayName.SetDefault("Mechanical Beast");
            Main.npcFrameCount[npc.type] = 6;
        }
        public override void SetDefaults()
        {
            npc.aiStyle = 5;
            npc.lifeMax = 1000;
            npc.damage = 5;
            npc.defense = 15;
            npc.knockBackResist = 0f;
            npc.width = 100;
            npc.height = 100;
            npc.value = Item.buyPrice(0, 20, 0, 0);
            npc.npcSlots = 15f;
            npc.boss = true;
            npc.lavaImmune = true;
            npc.noGravity = true;
            npc.noTileCollide = true;
            npc.HitSound = SoundID.NPCHit1;
            npc.DeathSound = SoundID.NPCDeath1;
            npc.buffImmune[144] = true;
            music = MusicID.Boss2;
        }
        //public override void OnSpawn() //optional
        //{

        //}

        public override void AI() //this is where you program your AI
        {

        }

        //public override void HitEffect(int hitDirection, double damage, bool isDead) //This is for whenever your boss gets hit by an attack. Create dust or gore.
        //{

        //}

        //public override void SelectFrame(int frameSize) //This is for animating your boss, such as how Queen Bee changes between charging or hovering images, or how Pumpking rotates its face.
        //{

        //}

        //public override void SetupLootRules(NPC unused) //this is what makes special things happen when your boss dies, like loot or text
        //{
    }
}
Your eyes are probably bleeding after seeing my code, I am really sorry, im just bad at coding : [
Anyway here is the texture
MechanicalBeast.png

(That is DEFINETELIY not an official texture, I'm just using it for testing purposes)
If anyone knows how to fix that, please reply, that would help me a lot.
 
npc.value can stay like that, what matters is that your using an existing aiStyle, which has its own predetermined way of animating. If you want to animate something like vanilla, you need to make sure whatever ai/NPC your copying from has the same frames as your spritesheet, and then add
animationType = NPCID.Zombie;
to SetDefaults (replace Zombie with whatever npc also has the aistyle of 5 and you want its animation to use)
Example of that: tModLoader/tModLoader

If you want to control how your NPC animates yourself, use the FindFrame hook, example here: tModLoader/tModLoader
 
remove this:
npc.value = Item.buyPrice(0, 20, 0, 0);
Op- I didn't noticed that, Thank you so much :D
npc.value can stay like that, what matters is that your using an existing aiStyle, which has its own predetermined way of animating. If you want to animate something like vanilla, you need to make sure whatever ai/NPC your copying from has the same frames as your spritesheet, and then add
animationType = NPCID.Zombie;
to SetDefaults (replace Zombie with whatever npc also has the aistyle of 5 and you want its animation to use)
Example of that: tModLoader/tModLoader

If you want to control how your NPC animates yourself, use the FindFrame hook, example here: tModLoader/tModLoader
Bruh now I feel like an idiot, that makes so much sense, seriously thanks, I'm going to test that to see if it works.
 
Back
Top Bottom