WiseNPCrappel: NPC police rappel
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_metropoliceentity 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
Using the simple method requires that you hide the
npc_metropolice until its time to rappel.
In this project the
trigger_once is used to spawn the
npc_metropolice by way of an
|Num of NPCs
|Max live NPCs
|Name of template NPC
|Waiting to Rappel
|Number of manhacks
|Pistols start drawn
|Fall to ground
|AI state to set
|Set state to COMBAT
|Schedule to run
|Set enemy to Goal Entity AND Run to Goal Entity
|Damage or Death
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.
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.