Code: Select all
{
Spawn[() // spawn actor
{
Console(false); //display console
AttributeOrder("enemy_health",100,"Die"); //Set health attribute, ammount of health, and death seen
FindTargetOrder(200,"Alert","health"); //sets vision distance, section called when target is found
SetFOV(360); //set field of vision
HostilePlayer(true); //Hostile to player
HostileSame(false); //Hostile to each other
HostileDifferent(false); //Hostile to other pawns
SetGroup("Enemy"); // Enemy Group
}]
Die[()
{
AnimateStop("die",0,""); //Death Animation
FadeOut(3,0); //Fade out actor
Remove(true); //remove pawn after death
}]
Alert[() // page 126
{
PlayerDistOrder(-800,"LostTarget"); //Distance at which it can detect a target
AnimateStop("idle",0,""); //play idle animatino when lost
NewOrder("Attack"); //play attack animation when found
}]
Attack[() // page 128
{
RotateToPlayer("walk",160,false,""); //page 129
FireProjectile("pistol_shell","BIP01 R FOREARM",0,0,0,"health","");
//Delay("hit",1,"");
if(self.player_range>96)
{
MoveForward("walk",50,50,"");
}
else
{
Delay("hit",1,"");
}
RestartOrder();
}]
LostTarget[()
{
BlendToAnimation("idle", 1, true, "");
FindTargetOrder(200,"Alert","health");
}]