The full code and map may be found there, while I will reference parts of it this for this thread.
Within this pk3 I have a map with a custom zombie actor, which has 20 health and can resurrect upon death with the following state:
Code: Select all
Death:
POSS H 5;
POSS I 5 A_Scream;
POSS J 5 A_NoBlocking;
POSS K 5;
//POSS L -1;
POSS L random(20, 25);
//POSS R 2 Revive();
POSS K 5;
POSS JIH 5 HealThing(20);
Goto See;
//Goto Raise;
//Stop;
Code: Select all
script 100 ENTER{
int t;
int duration = 60;
int health = GetActorProperty(20,APROP_HEALTH);
while(true){
t = Timer() / 35;
health = GetActorProperty(20,APROP_HEALTH);
SetFont("BIGFONT");
HudMessage(s:"Zombie: ", d:(health),
s:"\n",
d:(duration - (t%10));
HUDMSG_PLAIN,1, CR_RED, 0.1, 0.9, 0);
Delay(35);
}
}
and does not change thereafter. I suspect that upon it's death it loses it's ID.
furthermore, I have used some code from Deathmatch simulator to make these zombies fight amongst themselves, using the alliance flickering technique.
Code: Select all
virtual void DoAllianceFlicker()
{
// Randomly flick between friendly and unfriendly if you don't have a
// target, in order to simulate a free-for-all.
if (target == null && health > 0)
{
bFRIENDLY = random(0,1);
}
if (target != null && target.health > 0 && health > 0)
{
bFRIENDLY = random(0,1);
}
}
Which is appropriate zombie behaviour, but not what I would like them to do. I'm not sure what causes this.