That code looks right, so not sure what would be wrong. Is the script running properly?
The primary problem is that the heads are not spawning
Here's Both Scripts
npc script Aquamentus{ //broken piece of crap
void run(int HeadHP, int LooseHeadID){
npc head[3];
int heads = 1;
this->Immortal = true;
while(true){
if(this->HP <= 0){ //chopped off?
this->HP = HeadHP; //reset hp...
head[heads-1] = Screen->CreateNPC(LooseHeadID);
head[heads-1]->X = this->X;
head[heads-1]->Y = this->Y;
heads++;
}
if(heads==4) //fourth head is active
break;
else
Waitframe();
}
this->HP = HeadHP;
while(this->HP>0){ //big guy still alive?
Waitframe();
}
//kill heads
for (int i; i<3;i++){
head[i]->HP = -1000; //silently kill the heads.
}
//kill big guy
this->Immortal = false;
this->HP = 0; //DIE YOU MONSTER!
}
}
ffc script AquamentusLooseHead{
void run(int enemyID){
int clk = 0;
int clk2 = 0;
npc ghost = Ghost_InitAutoGhost(this,enemyID);
Ghost_Dir = Rand(8);
Ghost_SetFlag(GHF_FLYING_ENEMY | GHF_IGNORE_ALL_TERRAIN | GHF_NO_FALL);
while(ghost->isValid()){
Ghost_HP = 1000;
clk = Ghost_VariableWalk8(clk,ghost->Step,ghost->Rate,ghost->Homing,ghost->Hunger,ghost->Haltrate);
if(++clk2 > 72 && Rand(ghost->Attributes[0])==0){
Attack(ghost);
clk2=0;
}
Ghost_Waitframe(this,ghost,true,true);
}
}
void Attack(npc ghost){
eweapon fireballA = FireAimedEWeapon(ghost->Weapon, ghost->X, ghost->Y, 0, 175, ghost->WeaponDamage, SP_FIREBALL, SFX_FIREBALL, 0);
eweapon fireballB = FireAimedEWeapon(ghost->Weapon, ghost->X, ghost->Y, 0, 175, ghost->WeaponDamage, SP_FIREBALL, SFX_FIREBALL, 0);
eweapon fireballC = FireAimedEWeapon(ghost->Weapon, ghost->X, ghost->Y, 0, 175, ghost->WeaponDamage, SP_FIREBALL, SFX_FIREBALL, 0);
SetEWeaponMovement(fireballA, EWM_DRIFT_WAIT, DIR_UP,1);
SetEWeaponMovement(fireballB, EWM_DRIFT_WAIT, DIR_DOWN,1);
}
}
I'ved test the heads independently and those work fine I just cannot get them to spawn, and the COnsole isn't printing any errors either,
Edited by Jambu, 02 May 2024 - 05:44 PM.