WiseAssault: HL2 Hitman
This tutorial was originally created by wisemx. It was originally posted on SDKnuts.net.
Introduction
This is more of an advanced project and would take far too much time to go into detail on all of the details involved so I’m probably not going to cover everything, but I’ll try.
Events in this project:
- Hitman runs after Alyx.
- Alyx sees the hitman and runs away.
- Hitman assassinates Alyx.
- Hitman turns, runs away then stays hidden in the shadows.
Creation
The black effect was created by changing the effects for the npc_metropolice
. All that needs to be changed are these two properties:
- Render Mode: Color
- FX Color: 0 0 0
You won’t see the change in Hammer but you will once it’s running in HL2.
I didn’t include this next effect in the project but did test with it and the effect was great, however for another project, not this one. What I did was use the attachment point eyes for the npc_metropolice
and parent the combine ball model, it looked awesome but unfortunately not like a hitman. See WiseAttachment.
This project is a combination of the following entities:
ai_goal_assault
assault_assaultpoint
assault_rallypoint
ai_relationship
filter_activator_name
info_node
logic_auto
npc_alyx
npc_metropolice
scripted_sequence
Refer to those pages for additional help.
You will learn a lot more from this project by working with the sample vmf at the bottom of this page. Make some changes and compile, make additional changes and so on. Be sure to run buildcubemaps
after each new compile. The first player in this project is the logic_auto
. This is because it will fire off the ai_goal_assault
4 seconds after the map starts.
For the auto:
- Global State to Read: None
- Flag: Remove on Fire
My Output | Target Entity | Target Input | Parameter | Delay | Only Once | |
---|---|---|---|---|---|---|
OnMapSpawn | alyx_assault | Activate | 4.00 | Yes |
Properties for the ai_goal_assault
called from the logic_auto
above.
- Name: alyx_assault
- Actor(s) to affect: hitman
- Rally Point Set: assault_rally
- Search Type: Entity Name
- Start Active: No
- Assault Cue: Don't wait for a cue.
The two ai_relationship
entities are active at all times in this project.
- Subject: hitman
- Target: alyx01
- Disposition: Hate
- Start Active: Yes
- Reciprocal: No
- Subject: npc_metropolice
- Target: !player
- Disposition: Like
- Start Active: Yes
- Reciprocal: No
The two assault_assaultpoint
entities and their related assault_rallypoint
work together almost like paths for other entities. In this project I have configured these to best simulate the effect of a hitman. You have a lot of flexibility in the way you use these.
Class: assault_rallypoint
- Name: assault_rally
- Pitch Yaw Roll: Note, use the Point at button to create a direction of facing.
- Assault Point: assault_02
- Assault Delay: 0
- Priority: 1
Class: assault_assaultpoint
- Name: assault_01
- Pitch Yaw Roll: Note, use the Point at button to create a direction of facing.
- Next assault point: assault_02
- Assault time out: 0
- Clear on contact with enemies: Yes
- Allow diversion: No
- Never Timout: No
- Flag: Clear this point on arrival
Class: assault_assaultpoint
- Name: assault_02
- Pitch Yaw Roll: Note, use the Point at button to create a direction of facing.
- Next assault point: (none)
- Assault time out: 0
- Clear on contact with enemies: No
- Allow diversion: No
- Never Timout: No
- Flag: Clear this point on arrival
The filter_activator_name
entity is used in this project to illustrate how they can be used with an assault to filter for the correct player class by using them with triggers. Its purpose is to make sure only the npc_metropolice
triggers the scripted_sequence
that will cause Alyx to run away.
trigger_once
is a brush based entity created with the brush tool and trigger texture. Once the brush is created you convert it to a trigger_once
by pressing Ctrl+T and selecting trigger_once
from the list.
- Start Disabled: No
- Filter Name: hitman_filter
- Flag: NPCs
My Output | Target Entity | Target Input | Parameter | Delay | Only Once | |
---|---|---|---|---|---|---|
OnTrigger | alyxseq | BeginSequence | 0.00 | Yes |
Properties for the filter_activator_name
.
- Name: hitman_filter
- Filter Mode: Allow entities that match criteria
- Filter Name: hitman
There’s nothing fancy about the two scripted_sequence
entities used in this project. One of them is simply used to cause the hitman to run over to it once Alyx is dead. These are the properties for Alyx (npc_alyx
).
- Name: alyx01
- Weapons: Nothing
- Flags: Fall to Ground, Don’t drop weapons
My Output | Target Entity | Target Input | Parameter | Delay | Only Once | |
---|---|---|---|---|---|---|
OnDamaged | alyx01 | SetHealth | 0 | 0.00 | Yes | |
OnDeath | seq01 | BeginSequence | 1.50 | Yes |
The first output is important. Alyx is rather difficult to kill and our hitman would stand there shooting at her for some time, but with the help of this one output she will die almost instantly, which will look more like a hit. The second output begins the sequence that will cause our hitman to run away and hide.
These are the properties for the two scripted_sequence
entities.
- Name: alyxseq
- Target NPC: alyx01
- Pre action animation: d2_coast03_PostBattle_Idle01
- Action animation: d2_coast03_PostBattle_Idle01
- Move to position: Run
- Flag: Override AI
- Name: seq01
- Target NPC: hitman
- Move to position: Run
- Flag: Override AI
Notice that seq01, for the hitman, has no Action scripts set. For the overall effect to work Alyx needs to look scared but our hitman is already doing exactly what we want, the sequence used for the hitman simply causes it to run into the corner where it is located. It’s important to set the properties for the npc_metropolice
as needed.
- Name: hitman
- Render Mode: Color
- FX Color: 0 0 0
- Sleep State: None
- Waiting to Rappel: No
- Weapons: SMG1
- Number of Manhacks: None
- Pistol Starts Drawn: No
- Flags: Prevent Manhack toss, Allowed to respond to thrown objects, Fall to Ground, Think outside PVS, Don’t drop weapons
There’s nothing special about all of the info_node
entities in this project, they are simply placed around the map where the NPC’s might need to walk or run. Take them away and the NPC’s will not be able to follow orders.
I may have missed something and I know this page will be difficult for a lot of mappers to understand but if that’s the case please open the sample project below in Hammer and learn from it instead by experimenting with the entire works hands on. Click on the links I’ve provided on this page for additional help on any of the topics covered in this project.