Police rappel and jump
Combine Police Rappels, Combine Police jumps down from above.
The sample file for this project, at the page bottom, illustrates:
- Combine Police Rappels from ceiling then jumps down to join the attack.
- Second Combine Police jumps down from above and begins to attack.
As you see there are two methods of getting NPC’s to jump down from heights illustrated in this project.
- The first method is a scripted_sequence that begins when the rappelling Combine Police has completed its rappel.
- The second method uses info_node_hint entities to get the Combine Police to jump down.
Both methods require some finessing. The NPC won’t jump down if it is too far and in the first method the animation is already set so you need to use landing points that match.
As you can see in this project I’ve created an electrical panel and a toolbox for the first Combine Police to jump down onto.
These are brush based and work out well for a project like this.
For the second Combine Police that makes use of info_node_hint entities I’ve created a group for the hints this NPC will use. This is to keep the NPC from getting distracted.
The first method works much better as the info_node_hint method can easily be interrupted by other events in your project.
Note:The first Combine Police spawns with a point_template but not the second one. This is to illustrate how both methods can work either way.
It is much more efficient to spawn your NPCs with templates when needed and then target them with the kill command once they are no longer needed. The template in this project could have handled both NPCs.
The first Combine Police
These are the setting for the first Combine Police.
npc_metropolice
Class: npc_metropolice
|
|
Keyvalues
|
Comments
|
Name
|
Police01
|
|
Waiting to rappel
|
Yes
|
|
Weapons
|
SMG1
|
|
Number of manhacks
|
None
|
|
Pistols start drawn
|
No
|
|
|
|
point_template
|
Flag
|
|
|
|
|
|
Preserve entity names
|
|
|
|
|
scripted_sequence
Class: scripted_sequence
|
|
Keyvalues
|
Comments
|
Name
|
police01_jumpss
|
|
Target NPC
|
police01
|
|
Action Animation
|
canal1jump1
|
|
Move to Position
|
Run
|
|
|
|
|
Flag
|
|
|
|
|
|
No interruptions
|
|
|
|
|
Override AI
|
|
|
|
|
trigger_once
This trigger_once starts the events into place.
ai_relationship
The ai_relationship is used to keep the first Combine Police from shooting until it has jumped down. The second Combine Police will shoot at will and still jump down.
Note:The scripted_sequence will revert the initial relationship when the sequence has completed.
Class: ai_relationship
|
|
Keyvalues
|
Comments
|
Name
|
police01_ai
|
|
Subjects
|
!player
|
|
Disposition
|
Like
|
|
Start Active
|
Yes
|
|
Reciprocal
|
No
|
|
|
|
On the ground level for the first Combine Police I’ve placed one info_node but even this isn’t needed as its motions are all scripted up until the point where the NPC begins to attack. The effect I’ve created for this NPC is a spot it will jump down to and defend.
The second Combine Police
These are the properties for the second Combine Police.
npc_metropolice
Class: npc_metropolice
|
|
Keyvalues
|
Comments
|
Name
|
Police02
|
|
Hint Group
|
jump02
|
|
Waiting to rappel
|
No
|
|
Weapons
|
Pistol
|
|
Number of manhacks
|
None
|
|
Pistols start drawn
|
Yes
|
|
|
|
|
Flag
|
|
|
|
|
|
Allowed to respond to thrown objects
|
|
|
|
|
Fall to Ground
|
|
|
|
|
info_node_hint
The info_node_hint entities under and in front of this NPC.
scripted_sequence
The scripted_sequence used for this NPC.
Note:The flags are very important for our second NPC
|
Flag
|
|
|
|
|
|
No Interruptions
|
|
|
|
|
Override AI
|
|
|
|
|
Priority Script
|
|
|
|
|
Wrap up
There’s a lot more you can do, hopefully this article have stimulated your imagination.
Credits