WiseNPCrappel: Difference between revisions
Plykkegaard (talk | contribs) (wiseNPCrappel a tutorial ported from sdknuts.net originally created by wisemx) |
mNo edit summary |
||
(5 intermediate revisions by 3 users not shown) | |||
Line 1: | Line 1: | ||
{{DISPLAYTITLE:WiseNPCrappel: NPC police rappel}} | |||
{{SDKNuts Tutorials}} | |||
{{wisemxport|[[User:Plykkegaard|Peter [AGHL]]] 15:22, 17 Feb 2008 (PST)}} | |||
{{Note|This is part of a series of tutorials on NPC’s.}} | {{Note|This is part of a series of tutorials on NPC’s.}} | ||
[[ | [[File:wiseNPCrappel01.jpg|thumb|150px|right|Rapelling]] | ||
The sample file for this project, at the page bottom, illustrates: | The sample file for this project, at the page bottom, illustrates: | ||
# Player spawns in cement room with hole in ceiling. | #Player spawns in cement room with hole in ceiling. | ||
# Combine | #Combine police rappels from hole. | ||
# Once on ground begins attacking player. | #Once on ground begins attacking player. | ||
These are very simple to setup in your maps. | These are very simple to setup in your maps. | ||
I’m doing more in this project than is necessary. | I’m doing more in this project than is necessary. | ||
# You don’t have to spawn the NPC with an | #You don’t have to spawn the NPC with an {{ent|npc_template_maker}}. Using one however is better on performance and keeps the NPC hidden until needed. | ||
# You don’t need the | #You don’t need the {{ent|aiscripted_schedule}}. But it is a simple addition creating a much better effect. | ||
The simple method is to: | The simple method is to: | ||
# Place an | #Place an {{ent|npc_metropolice}} entity in the map where you want it to rappel from. | ||
# Set the property ''Waiting to rappel'' to ''Yes''. | #Set the property '''Waiting to rappel''' to '''Yes'''. | ||
# From any other entity, like a trigger, send the | #From any other entity, like a trigger, send the input <code>BeginRappel</code>. | ||
Using the simple method requires that you hide the <code>npc_metropolice</code> until its time to rappel. | |||
===Entities=== | |||
In this project the {{ent|trigger_once}} is used to spawn the <code>npc_metropolice</code> by way of an <code>npc_template_maker</code>. | |||
====trigger_once==== | |||
{{entity-kvalue-start|[[trigger_once]]}} | |||
{{entity-kvalue|Start disabled|No|}} | |||
{{entity-kvalue-end}} | |||
{{entity-flag-start}} | |||
{{entity-flag|Clients|on|}} | |||
{{entity-flag-end}} | |||
{{entity-output-start}} | |||
{{entity-output||OnTrigger|rappel1maker|Spawn||||}} | |||
{{entity-output-end}} | |||
====npc_template_maker==== | |||
{{entity-kvalue-start|[[npc_template_maker]]}} | |||
{{entity-kvalue|Start disabled|Yes|}} | |||
{{entity-kvalue|Num of NPCs|1|}} | |||
{{entity-kvalue|Frequency|1|}} | |||
{{entity-kvalue|Max live NPCs|1|}} | |||
{{entity-kvalue|Name of template NPC|rappel1|}} | |||
{{entity-kvalue-end}} | |||
{{entity-output-start}} | |||
{{entity-output||OnSpawnNPC|rappel1|BeginRappel||0.25||}} | |||
{{entity-output-end}} | |||
====npc_metropolice==== | |||
{{entity-kvalue-start|[[npc_metropolice]]}} | |||
{{entity-kvalue|Waiting to Rappel|Yes|}} | |||
{{entity-kvalue|Weapons|SMG|}} | |||
{{entity-kvalue|Number of manhacks|None|}} | |||
{{entity-kvalue|Pistols start drawn|Yes|}} | |||
{{entity-kvalue-end}} | |||
{{entity-flag-start}} | |||
{{entity-flag|Clients|on|}} | |||
{{entity-flag|Simple cops|on|}} | |||
{{entity-flag|Fall to ground|on|}} | |||
{{entity-flag|Template NPC|on|}} | |||
{{entity-flag-end}} | |||
{{entity-output-start}} | |||
{{entity-output||OnRappelTouchdown|rappel1ss|StartSchedule||0.0||}} | |||
{{entity-output-end}} | |||
=== | ===={{ent|aiscripted_schedule}}==== | ||
{{entity-kvalue-start|[[aiscripted_schedule]]}} | |||
{{entity-kvalue|Name|rappel1ss|}} | |||
{{entity-kvalue|AI state to set|Set state to COMBAT|}} | |||
{{entity-kvalue|Schedule to run|Set enemy to Goal Entity AND Run to Goal Entity|}} | |||
{{entity-kvalue|Interruptability|Damage or Death|}} | |||
{{entity-kvalue|Goal entity|!player|}} | |||
{{entity-kvalue-end}} | |||
In | ===Setup in Hammer=== | ||
In the image below you can see the <code>npc_metropolice</code> waiting to rappel, and the <code>trigger_once</code> that will begin the rappel. | |||
<gallery> | <gallery> | ||
image:wiseNPCrappel02.jpg|waiting to rappel | image:wiseNPCrappel02.jpg|waiting to rappel | ||
image:wiseNPCrappel03.jpg|Trigger for the event | image:wiseNPCrappel03.jpg|Trigger for the event | ||
</gallery> | </gallery> | ||
I’ve placed | I’ve placed {{ent|info_node}} entities on the ground in random spots to give the NPC Police walking hints. | ||
That’s all there is to it. Give them enough room to rappel and they can drop off ledges, from planes or out of holes in the ceiling. | That’s all there is to it. Give them enough room to rappel and they can drop off ledges, from planes or out of holes in the ceiling. | ||
== | ==See also== | ||
*[http://type3studios.com/downloads/tutorials/SdkNutsTutorials/wiseNPCrappel.zip Example VMF] | |||
* [http://type3studios.com/downloads/tutorials/SdkNutsTutorials/wiseNPCrappel.zip | *[https://cdn.discordapp.com/attachments/434089157875466242/463749622242738176/wiseNPCrappel.vmf Example VMF backup] | ||
* | *[[WiseNPCrapjump]] | ||
[[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:
- Player spawns in cement room with hole in ceiling.
- Combine police rappels from hole.
- Once on ground begins attacking player.
These are very simple to setup in your maps.
I’m doing more in this project than is necessary.
- You don’t have to spawn the NPC with an npc_template_maker. Using one however is better on performance and keeps the NPC hidden until needed.
- You don’t need the aiscripted_schedule. But it is a simple addition creating a much better effect.
The simple method is to:
- Place an npc_metropolice entity in the map where you want it to rappel from.
- Set the property Waiting to rappel to Yes.
- From any other entity, like a trigger, send the input
BeginRappel
.
Using the simple method requires that you hide the npc_metropolice
until its time to rappel.
Entities
In this project the trigger_once is used to spawn the npc_metropolice
by way of an npc_template_maker
.
trigger_once
Class: trigger_once | ||
Keyvalues | Comments | |
Start disabled | No | |
Flag | ||||
![]() |
Clients | |||
My output | Target entity | Target input | Parameter | Delay | Only once | Comments | ||
![]() |
OnTrigger | rappel1maker | Spawn | |||||
npc_template_maker
Class: npc_template_maker | ||
Keyvalues | Comments | |
Start disabled | Yes | |
Num of NPCs | 1 | |
Frequency | 1 | |
Max live NPCs | 1 | |
Name of template NPC | rappel1 | |
My output | Target entity | Target input | Parameter | Delay | Only once | Comments | ||
![]() |
OnSpawnNPC | rappel1 | BeginRappel | 0.25 | ||||
npc_metropolice
Class: npc_metropolice | ||
Keyvalues | Comments | |
Waiting to Rappel | Yes | |
Weapons | SMG | |
Number of manhacks | None | |
Pistols start drawn | Yes | |
Flag | ||||
![]() |
Clients | |||
![]() |
Simple cops | |||
![]() |
Fall to ground | |||
![]() |
Template NPC | |||
My output | Target entity | Target input | Parameter | Delay | Only once | Comments | ||
![]() |
OnRappelTouchdown | rappel1ss | StartSchedule | 0.0 | ||||
aiscripted_schedule
Class: aiscripted_schedule | ||
Keyvalues | Comments | |
Name | rappel1ss | |
AI state to set | Set state to COMBAT | |
Schedule to run | Set enemy to Goal Entity AND Run to Goal Entity | |
Interruptability | Damage or Death | |
Goal entity | !player | |
Setup in Hammer
In the image below you can see the npc_metropolice
waiting to rappel, and the trigger_once
that will begin the rappel.
I’ve placed info_node entities on the ground in random spots to give the NPC Police walking hints.
That’s all there is to it. Give them enough room to rappel and they can drop off ledges, from planes or out of holes in the ceiling.