WiseNPCrapjump: Difference between revisions
Plykkegaard (talk | contribs) m (Added category: Level Design Tutorials) |
mNo edit summary |
||
(5 intermediate revisions by 2 users not shown) | |||
Line 1: | Line 1: | ||
{{DISPLAYTITLE:WiseNPCrapjump: Police rappel and jump}} | |||
{{SDKNuts Tutorials}} | |||
{{wisemxport|[[User:Plykkegaard|Peter [AGHL]]] 12:26, 23 Feb 2008 (PST)}} | |||
{| style="float: right; clear: right; background-color: transparent; margin-left: 1.4em" cellpadding="0" cellspacing="0" | {| style="float: right; clear: right; background-color: transparent; margin-left: 1.4em" cellpadding="0" cellspacing="0" | ||
|[[ | |[[File:wiseNPCrapjump01.jpg|thumb|150px|right|Police rappel and jump]] | ||
|- | |- | ||
|[[ | |[[File:wiseNPCrapjump02.jpg|thumb|150px|right|First Combine Police]] | ||
|- | |- | ||
|[[ | |[[File:wiseNPCrapjump03.jpg|thumb|150px|right|Second Combine Police]] | ||
|} | |} | ||
{{Note|This is an extension of the [[WiseNPCrappel]].}} | |||
{{Note|This is an extension of the [[ | |||
The sample file for this project, at the page bottom, illustrates: | The sample file for this project, at the page bottom, illustrates: | ||
* Combine Police Rappels from ceiling then jumps down to join the attack. | *Combine Police Rappels from ceiling then jumps down to join the attack. | ||
* Second Combine Police jumps down from above and begins to 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. | 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 | *The first method is a {{ent|scripted_sequence}} that begins when the rappelling Combine Police has completed its rappel. | ||
* The second method uses | *The second method uses {{ent|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. | 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. | ||
Line 28: | Line 24: | ||
These are brush based and work out well for a project like this. | These are brush based and work out well for a project like this. | ||
For the second Combine Police that makes use of | For the second Combine Police that makes use of <code>info_node_hint</code> 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 <code>info_node_hint</code> method can easily be interrupted by other events in your project. | |||
{{Note|The first Combine Police spawns with a {{ent|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. | These are the setting for the first Combine Police. | ||
===== npc_metropolice ===== | =====npc_metropolice===== | ||
<div style="position: relative;float: Left;width: 80%;padding: 0px;"> | <div style="position: relative;float: Left;width: 80%;padding: 0px;"> | ||
{{entity-kvalue-start| | {{entity-kvalue-start|{{{ent|npc_metropolice}}}} | ||
{{entity-kvalue|Name|Police01|}} | {{entity-kvalue|Name|Police01|}} | ||
{{entity-kvalue|Waiting to rappel|Yes|}} | {{entity-kvalue|Waiting to rappel|Yes|}} | ||
Line 57: | Line 51: | ||
{{entity-output-end}} | {{entity-output-end}} | ||
===== point_template ===== | =====point_template===== | ||
{{entity-kvalue-start|[[point_template]]}} | {{entity-kvalue-start|[[point_template]]}} | ||
{{entity-kvalue|Name|police01_template|}} | {{entity-kvalue|Name|police01_template|}} | ||
Line 68: | Line 61: | ||
{{entity-flag-end}} | {{entity-flag-end}} | ||
===== scripted_sequence ===== | =====scripted_sequence===== | ||
{{entity-kvalue-start|[[scripted_sequence]]}} | {{entity-kvalue-start|[[scripted_sequence]]}} | ||
{{entity-kvalue|Name|police01_jumpss|}} | {{entity-kvalue|Name|police01_jumpss|}} | ||
Line 86: | Line 78: | ||
{{entity-output-end}} | {{entity-output-end}} | ||
===== trigger_once ===== | =====trigger_once===== | ||
This {{ent|trigger_once}} starts the events into place. | |||
This | |||
{{entity-kvalue-start|[[trigger_once]]}} | {{entity-kvalue-start|[[trigger_once]]}} | ||
Line 104: | Line 95: | ||
{{entity-output-end}} | {{entity-output-end}} | ||
===== ai_relationship ===== | =====ai_relationship===== | ||
The {{ent|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. | |||
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.}} | {{Note|The scripted_sequence will revert the initial relationship when the sequence has completed.}} | ||
Line 120: | Line 110: | ||
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. | 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 === | ===The second Combine Police=== | ||
These are the properties for the second Combine Police. | These are the properties for the second Combine Police. | ||
===== npc_metropolice ===== | =====npc_metropolice===== | ||
{{entity-kvalue-start|[[npc_metropolice]]}} | {{entity-kvalue-start|[[npc_metropolice]]}} | ||
{{entity-kvalue|Name|Police02|}} | {{entity-kvalue|Name|Police02|}} | ||
Line 140: | Line 128: | ||
{{entity-flag-end}} | {{entity-flag-end}} | ||
===== info_node_hint ===== | =====info_node_hint===== | ||
The <code>info_node_hint</code> entities under and in front of this NPC. | |||
The info_node_hint entities under and in front of this NPC. | |||
{{entity-kvalue-start|[[info_node_hint]]}} | {{entity-kvalue-start|[[info_node_hint]]}} | ||
Line 150: | Line 137: | ||
{{entity-kvalue-end}} | {{entity-kvalue-end}} | ||
===== scripted_sequence ===== | =====scripted_sequence===== | ||
The <code>scripted_sequence</code> used for this NPC. | |||
The scripted_sequence used for this NPC. | |||
{{Note|The flags are very important for our second NPC}} | {{Note|The flags are very important for our second NPC}} | ||
Line 171: | Line 157: | ||
Compile the project and have a look, the two methods used here came out rather nice together. | Compile the project and have a look, the two methods used here came out rather nice together. | ||
[[ | [[File:wiseNPCrapjump05.jpg]] | ||
--> | --> | ||
== | ==See also== | ||
*[http://www.type3studios.com/downloads/tutorials/SdkNutsTutorials/wiseRapJump.zip Example VMF] | |||
* [http://www.type3studios.com/downloads/tutorials/SdkNutsTutorials/wiseRapJump.zip | *[https://cdn.discordapp.com/attachments/434089157875466242/463746902056501277/wiseRapJump.vmf Example VMF backup] | ||
* | |||
[[Category:Level Design | [[Category:Level Design]] |
Latest revision as of 07:26, 15 April 2024
This tutorial was originally created by wisemx. It was originally posted on SDKnuts.net.

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.

The first Combine Police
These are the setting for the first Combine Police.
npc_metropolice
{{entity-kvalue-start|npc_metropolice} |align="left" style="padding-left:10px; background: 262626; font-size:90%; border-left: thin solid grey;"|Name |align="left" style="padding-left:10px; background: 262626; font-size:90%; border-right: thin solid grey; padding-right:10px; "|Police01 |align="left" style="padding-left:10px; font-size:90%;"| |- |align="left" style="padding-left:10px; background: 262626; font-size:90%; border-left: thin solid grey;"|Waiting to rappel |align="left" style="padding-left:10px; background: 262626; font-size:90%; border-right: thin solid grey; padding-right:10px; "|Yes |align="left" style="padding-left:10px; font-size:90%;"| |- |align="left" style="padding-left:10px; background: 262626; font-size:90%; border-left: thin solid grey;"|Weapons |align="left" style="padding-left:10px; background: 262626; font-size:90%; border-right: thin solid grey; padding-right:10px; "|SMG1 |align="left" style="padding-left:10px; font-size:90%;"| |- |align="left" style="padding-left:10px; background: 262626; font-size:90%; border-left: thin solid grey;"|Number of manhacks |align="left" style="padding-left:10px; background: 262626; font-size:90%; border-right: thin solid grey; padding-right:10px; "|None |align="left" style="padding-left:10px; font-size:90%;"| |- |align="left" style="padding-left:10px; background: 262626; font-size:90%; border-left: thin solid grey;"|Pistols start drawn |align="left" style="padding-left:10px; background: 262626; font-size:90%; border-right: thin solid grey; padding-right:10px; "|No |align="left" style="padding-left:10px; font-size:90%;"| |- |colspan="2" style="border-top: thin solid grey;"| || |}
Flag | ||||
![]() |
Simple cops | |||
My output | Target entity | Target input | Parameter | Delay | Only once | Comments | ||
![]() |
OnRappelTouchdown | police01_jumpss | BeginSequence | 0.25 | Yes | |||
point_template
Class: point_template | ||
Keyvalues | Comments | |
Name | police01_template | |
Template 1 | police01 | |
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 | |||
My output | Target entity | Target input | Parameter | Delay | Only once | Comments | ||
![]() |
OnEndSequence | police01_ai | RevertRelationship | |||||
trigger_once
This trigger_once starts the events into place.
Class: trigger_once | ||
Keyvalues | Comments | |
Start disabled | No | |
Flag | ||||
![]() |
Clients | |||
My output | Target entity | Target input | Parameter | Delay | Only once | Comments | ||
![]() |
OnTrigger | police01_template | ForceSpawn | 1.0 | Yes | |||
![]() |
OnTrigger | police02_ss | BeginSequence | 1.0 | Yes | |||
![]() |
OnTrigger | police01 | BeginRappel | 1.5 | Yes | |||
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.

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.
Class: info_node_hint | ||
Keyvalues | Comments | |
Hint | Override jump permission | |
Start disabled | No | |
Hint Group | jump02 | |
scripted_sequence
The scripted_sequence
used for this NPC.

Class: scripted_sequence | ||
Keyvalues | Comments | |
Name | police02_ss | |
Target NPC | police02 | |
Move to position | Run | |
Flag | ||||
![]() |
No Interruptions | |||
![]() |
Override AI | |||
![]() |
Priority Script | |||