Zombies rising from toxic water

Tutorial collection, comprehensive listings on main site.

Zombies rising from toxic water

Postby Tutorial on Tue Apr 30, 2013 7:51 pm

category
General Half-Life 2/Entities

description
Make zombies rise up from toxic water

keywords
zombie, water, npc, env_entity_maker, logic_case.

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

outputs:
"OnBeginSequence / zombie_01_snd / PlaySound"

3) Create a logic_relay
- name it "zombie_01_relay"

outputs:
"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"

outputs:
"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
Image

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
(example trigger_once)
"OnStartTouch / zombie_01_timer / Enable" to start spawning zombies
"OnStartTouch / zombie_01_timer / Disable" to stop spawning zombies

- marnamai
- Don't send PM's to this user -
Tutorial
Not A Real User
 
Joined: Sun Mar 06, 2005 11:00 pm

Re: Zombies rising from toxic water

Postby Syphon on Fri Jun 14, 2013 10:43 am

Thank you! I did not follow your tutorial step by step but I found it really helpful for finding out about how the env_entity_maker and logic_case entities work.

I guess this is obvious for many, but it would be good to mention: The entities added to the point_template do not spawn at the origin of the env_entity_maker but retain their position relative to the point_template (which is essential if your template is composed of multiple objects). But if you want to spawn 1 object in a random position, it is important the origin of that object is lined up with the origin of the point_template.
Syphon
Regular
Regular
 
Joined: Tue Dec 09, 2008 12:53 pm
Location: the Netherlands

Return to Tutorials

Who is online

Users browsing this forum: No registered users

cron