Did you actually see the script?
//Thanks go to pkmnfrk for the moveTowards() function and the advmath.zh file.
//http://www.armageddongames.net/forums/#post1202737#post1202737
//"advmath.zh" can be found here: http://www.armageddongames.net/forums/#post1202755#post1202755
import "std.zh"
import "advmath.zh"const int CSET_TEAM=10;
const int CSET_DEADSTATE=8;
const int CSET_SOLO=8;
const int CMB_DEADSTATE=24404;
const int CMB_1x1_SHADOW=24398;
const int CMB_ARMOS_TEAM=24396;
const int SFX_JUMPSTOMP=66;
const int SFX_FALLING=65;
// Method to move a FFC angularly based on a target location
// and speed without constant supervision
// Parameters
// ffc combo - The FFC to be moved
// int targetX - The target X location
// int targetY - The target Y location
// int speed - The total FFC movement speed
void angularMove(ffc combo, int targetX, int targetY, int speed)
{
// Calculate the distance to the target location
int xDis = targetX - combo->X;
int yDis = targetY - combo->Y;
int dis = Abs(xDis) + Abs(yDis);
// Calculate the speed coefficient
float d = speed / dis;
// Calculate the speeds for each direction
combo->Vx = d * xDis;
combo->Vy = d * yDis;
} // End of angularMove
//Note: To set it up, you'll have to create 4 npcs and 4 ffcs in order to create 4 armos etc.
ffc script LTTP_ArmosKnight
{
//D0:Choose a number from 1 to 4. Each number represent the npc number in the list. Also represents the ffc number in the list of this armos.
//D1:The time in frames that the Armos Knights have to wait until they get in a row.
//D2:The time in frames that the Armos Knight while he's alone has to wait until he fall from the sky.
//D3:The damage in quarters hearts when Link is hit.
//D4:The initial HP of the Armos.
//D5:The initial HP of the Armos in solo
void run(int n,int dt, int ds,int d,int h,int hf)
{
Waitframes(4);
int x1;int x2;
int y1;int y2;
int LinkCurrentHP=Link->HP;
bool isDead;
bool isNotPlayed;
bool isFalling;bool isReturning;
npc ghosted=Screen->LoadNPC(n);
ghosted->Damage=d;
ghosted->HP=h;
ffc armos=Screen->LoadFFC(n);
ffc shadow=Screen->LoadFFC(n+4);
bool isStill;
bool check;
bool solo=true;bool soloAttack;
bool team;
int delaysolo=ds;
int delaystill=30;
int delayIsDead=300;
int shadowx;
int shadowy;
//INIT//
shadow->X=Link->X;
shadow->Y=Link->Y;
armos->X=Link->X-8;
armos->Y=0;
while(true)
{
if(Screen->NumNPCs()==1)solo=true;
if(Screen->NumNPCs()>1)team=true;
if(Screen->NumNPCs()<=0)
{
isDead=true;
break;
}
if(team)
{
if(Screen->NumNPCs()>1&&ghosted->HP==0)isDead=true;
if(Screen->NumNPCs()==1&&ghosted->HP==0)
{
team=false;
solo=true;
isReturning=true;
}
armos->Data=CMB_ARMOS_TEAM;
armos->CSet=CSET_TEAM;
}
if(solo)
{
if(!check)
{
ghosted->HP=hf;
check=true;
}
if(delaysolo>0)
{
delaysolo-=1;
//Placing armos above Link's head
armos->X=Link->X-8;
armos->Y=0;
//Making the armos invulnerable and untouchable
ghosted->Damage=0;
ghosted->HitHeight=0;
ghosted->HitWidth=0;
armos->Flags[FFCF_OVERLAY]=true;
//Drawing the shadow on Link
shadow->X=Link->X;shadow->Y=Link->Y;
}
if(delaysolo<=0)
{
if(!isNotPlayed)
{
shadowx=shadow->X;
shadowy=shadow->Y;
isFalling=true;
Game->PlaySound(SFX_FALLING);
isNotPlayed=true;
}
if(isFalling)
{
shadow->X=shadowx;shadow->Y=shadowy;
ghosted->Damage=0;
ghosted->HitHeight=0;
ghosted->HitWidth=0;
armos->Flags[FFCF_OVERLAY]=true;
armos->Y+=4;
if(armos->Y>=shadowy-16)
{
Game->PlaySound(SFX_JUMPSTOMP);
armos->Y=shadow->Y-16;
isFalling=false;
isStill=true;
}
}
if(isStill)
{
armos->Flags[FFCF_OVERLAY]=false;
ghosted->HitHeight=32;
ghosted->HitWidth=32;
ghosted->Damage=ds;
delaystill-=1;
if(delaystill<=0)
{
isStill=false;
delaystill=30;
isReturning=true;
}
}
if(isReturning)
{
armos->Flags[FFCF_OVERLAY]=true;
ghosted->HitHeight=0;
ghosted->HitWidth=0;
ghosted->Damage=0;
angularMove(shadow, Link->X, Link->Y, 9);
angularMove(armos, Link->X-8, 0, 9);
shadow->X=armos->X+8;
if(armos->Y<=0)
{
armos->Vx=0;
armos->Vy=0;
shadow->Vx=0;
shadow->Vy=0;
armos->Y=0;
armos->X=Link->X-8;
shadow->X=Link->X;
shadow->Y=Link->Y;
isReturning=false;
isNotPlayed=false;
delaysolo=ds;
}
}
}
armos->Data=CMB_ARMOS_TEAM;
armos->CSet=CSET_SOLO;
armos->TileHeight=2;
armos->TileWidth=2;
ghosted->X=armos->X;
ghosted->Y=armos->Y;
}
ghosted->HP=5;
shadow->Data=CMB_1x1_SHADOW;
shadow->CSet=2;
shadow->Flags[FFCF_OVERLAY]=true;
shadow->Flags[FFCF_TRANS]=true;
if(ghosted->HP<=0)isDead=true;
if(isDead)break;
Waitframe();
}
while(isDead)
{
shadow->Data=0;
armos->Data=0;
delayIsDead-=1;
Screen->DrawCombo(3, armos->X, armos->Y, CMB_DEADSTATE, 1, 2,CSET_DEADSTATE, 1, 0, 0, 0,0, 0, true, 128);
Screen->DrawCombo(3, armos->X+16, armos->Y, CMB_DEADSTATE+1, 1, 2,CSET_DEADSTATE, 1, 0, 0, 0,0, 0, true, 128);
if(delayIsDead<=0)Quit();
Waitframe();
}
}
}
It dies even with that in the while(true) loop ?!
ghosted->HP=5;