Zombies rising from toxic water
In this tutorial we'll learn how to make zombies stand up from toxic water in random positions by using a env_entity_maker and a logic_case to select the random position.
1) Create a npc_zombie
- name it "zombie_01"
- disable the shadows
- give it a squad name "zombie_squad"
- set sleep state to "waiting for input, ignore PVS"
check these flags:
- wait for script
- fade corpse
2) Create a scripted_sequence
- name it "zombie_01_ss"
- set the target npc to "zombie_01"
- set the entry animation to "slump_b"
- set the action animation to "slumprise_b"
- set move to position to "instantaneous"
check these flags:
- start on spawn
- no interruptions
- override AI
- priority script
"OnBeginSequence / zombie_01_snd / PlaySound"
3) Create a logic_relay
- name it "zombie_01_relay"
"OnSpawn / zombie_01_ss / BeginSequence"
"OnSpawn/ zombie_01 /Wake / delay 1"
4) Create an ambient_generic
- name it "zombie_01_snd"
- set the sound name to "Zombie.Pain"
5) Create a point_template
- name it "zombie_01_template"
- add the 4 previously created entities to the template
uncheck this flag!
- preserve entity names (don't do name fixup)
6) Create a logic_timer
- name it "zombie_01_timer"
- set start disabled to "yes"
- set use random time to "yes"
- set min. random interval to "4"
- set max. random interval to "8"
"OnTimer / zombie_01_case / PickRandomShuffle" (don't worry, we 'll create the logic case next)
7) Create a logic_case
- name it "zombie_01_case"
- set every case to a number corresponding to their case for every spawnpoint you want to add
(example: Case 01 - 1, Case 02 - 2, and so on) do this for the first 8 cases
8) Create 8 env_entity_maker entities
(this is where the zombies will be spawning and play their standup animation)
- name them "zombie_01_entmaker01" to "zombie_01_entmaker08"
- set point_template to spawn to "zombie_01_template"
check this flag:
- forcespawn: only if there's room
9) Now we'll go back to the logic_case we created earlier
add the following outputs:
"OnCase01 / zombie01_entmaker01 / ForceSpawn"
"OnCase02 / zombie01_entmaker02 / ForceSpawn"
"OnCase03 / zombie01_entmaker03 / ForceSpawn"
"OnCase04 / zombie01_entmaker04 / ForceSpawn"
"OnCase05 / zombie01_entmaker05 / ForceSpawn"
"OnCase06 / zombie01_entmaker06 / ForceSpawn"
"OnCase07 / zombie01_entmaker07 / ForceSpawn"
"OnCase08 / zombie01_entmaker08 / ForceSpawn"
10) We're nearly done, all there is left to do is create a water brush with the "nature/toxicslime002a" texture, make sure the toxic water is deep enough to hide the spawning zombies ( 24 units should do the trick ).
Don't forget to add a trigger_hurt covering the toxic goo (damage type radiation) to hurt the player when he touches it.
You can enable/disable the spawning of the zombies by sending an input to the logic_timer
"OnStartTouch / zombie_01_timer / Enable" to start spawning zombies
"OnStartTouch / zombie_01_timer / Disable" to stop spawning zombies