AvP2’s Zombies

Inspiration strikes

Currently I’m playing S.T.A.L.K.E.R. and I have to admit, I am impressed. Although zombies are being (over)used quite a lot, they still remain scary. I mean they are not alive, but also not quite dead. There is a difference in between ‘breeds’ of zombies encountered in games and movies: most of them move slow, talking nonsense or just moaning. The zombies from Doom 3 and Return to Castle Wolfenstein however, had another feature that scared the pants off me: they resurrected.

Yep. You saw some bodies lying on the floor, looking “all nice and dead”, and as soon as you pass them by they get up and start hurting. You. They start hurting you. This is what I had in mind with this prefab: you walk across a hallway, and all of a sudden you spot your enemies. Obviously, you start rotating the barrels of the minigun and lay waste on them. You move forward, and just when you’re about to pass them you see something that sends chills down your spine: your ‘victims’ are slowly standing, and, after a minor inspection of themselves, they move to attack.

One possible sollution

The structure I settled for has the following elements:


Zombie0 is the actual AI unit. All other elements (PlayDead0, Resurrect0, StartFeeling0, StopFeeling0) are triggers. The functionallity of the prefab can be described in the following steps:

  • each time the AI unit takes damage, it triggers PlayDead0
  • after a number of messages received, PlayDead0 finally triggers
  • PlayDead0 makes the zombie play a death animation. At the same time, the StopFeeling0 and Resurrect0 triggers get triggered.
  • StopFeeling0 simply locks PlayDead0. This way, further damage cannot trigger another death animation
  • Resurrect0 sends it’s message 10 – 20 seconds after being triggered. This delay corresponds to the durration of the zombie “playing ‘possum”. The messages send by this trigger will cause the zombie to play the “get up” animation. A second message will trigger StartFeeling0.
  • StartFeeling0 simply unlocks (with a delay of 10 seconds, the time needed by the zombie to get up) the PlayDead0 trigger.

The triggers

Actually, we need to start with the AI unit itself:

As you perhaps already guessed, the AI has NEVERDESTROY set to true. However, it will process damage (CanDamage=TRUE). The message set each time the unit is damaged will trigger PlayDead0. Speaking of the devil, the settings for PlayDead0:


And here are some features, making the behaviour of our zombie quite interesting:

  • first of all, the trigger will ignore the message that comes within 1 second from the previous.
  • neither the player nor the AI are allowed to trigger it
  • it will wait for 5 messages before triggering

These settings will allow you to “kill” the zombie in about 5 seconds of gunfire; there is no distinction between a shotgun (which packs more punch per round) and the Pulse Rifle. These settings will make the zombie tougher or softer.

As I mentioned earlier, PlayDead0 also sends some messages:


The most important is, without a doubt, the message sent to the AI unit:

killscripts; scr (igd; pa Death_H; pla Collapse2)

First, terminate all running scripts. Then make the AI ignore damage (igd) and then ask him to play the fall animation (pa Death_H). Finally, keep the AI facing the ground with the last command (pla Collapse2). While lying down, the AI is still executing the script: no “end;” statement at the end of the script.

I already mentioned Resurrect0. Here are it’s basic settings:


SendDelay of 10 is the ammount of time the zombie is lying face down.

The messages sent by this one are as follow:


The first message is more interesting; it is sent to the AI unit:

scr+ (pa Collapse2_Getup; end)

Basically, it uses the script started by PlayDead0 and it asks the AI unit to get up.

The StopFeeling0 trigger is set up like this:


It simply locks the PlayDead0 trigger (see above).

The StartFeeling0 trigger unlocks the PlayDead0 trigger and resets all the senses of the AI unit. Reseting the senses is not mandatory, but I decided to add it:


The 10 seconds delay generated by SendDelay are needed to allow the AI unit to finish it’s animation; basically PlayDead0 shouldn’t take into account damage taken by the zombie while it’s defensless. Plus, it’s scarrier >:) .

The prefab is not fully copy-paste compliant; if you plan to add more zombies, make sure that the damage field from the AI unit points to the appropriate PlayDead trigger: Zombie1 should send it’s damage messages to PlayDead1, Zombie2 should send it’s damage messages to PlayDead2 and so on.

As usual, the archive contains both the .ed file and this very web page.

Of course, custom characters and AIButes can (and should) be added in the Attributes files, so that the zombies will moan and move slower and so on. I thought also of making a small map, using Michale Jackson’s “Thriller” as soundtrack, but I’ll leave that up to you.


Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s