WiseNPC06: Difference between revisions

From Valve Developer Community
Jump to navigation Jump to search
(Created page with "{{DISPLAYTITLE:WiseNPC06: NPC Helicopter}} {{wisemxport|~~~~}} Events in this project: #Helicopter takes off. #Begins patrol of the area. #Drops a single bomb. #Begins shooti...")
 
mNo edit summary
 
(2 intermediate revisions by 2 users not shown)
Line 1: Line 1:
{{DISPLAYTITLE:WiseNPC06: NPC Helicopter}}
{{DISPLAYTITLE:WiseNPC06: NPC Helicopter}}
{{SDKNuts Tutorials}}
{{wisemxport|[[User:Pinsplash|Pinsplash]] ([[User talk:Pinsplash|talk]]) 03:33, 21 July 2018 (UTC)}}
{{wisemxport|[[User:Pinsplash|Pinsplash]] ([[User talk:Pinsplash|talk]]) 03:33, 21 July 2018 (UTC)}}


==Introduction==
Events in this project:
Events in this project:
#Helicopter takes off.
#Helicopter takes off.
Line 12: Line 15:
Navigation for the <code>npc_helicopter</code> is done with {{ent|path_track}} and {{ent|info_node_air}} entities. It has a nice AI system that will allow it to patrol the area where you place these entities. Navigation for the {{ent|npc_citizen}} is done by placing {{ent|info_node}} entities on the ground. Some of the aspects of the Chopper that I don’t cover in this project are the avoidance and target systems you can use.
Navigation for the <code>npc_helicopter</code> is done with {{ent|path_track}} and {{ent|info_node_air}} entities. It has a nice AI system that will allow it to patrol the area where you place these entities. Navigation for the {{ent|npc_citizen}} is done by placing {{ent|info_node}} entities on the ground. Some of the aspects of the Chopper that I don’t cover in this project are the avoidance and target systems you can use.


==Creation==
In this project I simply added one <code>path_track</code> gave it a name and then with it selected held {{key|Shift}} and I would drag a clone to a new location. The process was repeated until all four were created then for the forth I added the name of the first <code>path_track<code> as its '''Next Stop Target'''. The whole process only takes a few seconds. The <code>info_node_air</code> entities are placed randomly around the map to give the Chopper a running path away from the tracks. It will drift along the combination of these entities.
In this project I simply added one <code>path_track</code> gave it a name and then with it selected held {{key|Shift}} and I would drag a clone to a new location. The process was repeated until all four were created then for the forth I added the name of the first <code>path_track<code> as its '''Next Stop Target'''. The whole process only takes a few seconds. The <code>info_node_air</code> entities are placed randomly around the map to give the Chopper a running path away from the tracks. It will drift along the combination of these entities.


Line 21: Line 25:


{| {{OutputsTable}}
{| {{OutputsTable}}
| [[Image:Io11.png]] || OnDamaged|| heli01|| Break|| || 0.25|| Yes
| [[File:Io11.png]] || OnDamaged|| heli01|| Break|| || 0.25|| Yes
|}
|}
Once the Citizen fires a rocket at the Chopper, and hits it, the Chopper will break apart 0.25 seconds later. Remove this behavior for the normal effect; it will take around 20 rockets to destroy it. ''(Porter's note: Exactly what difficulty setting are you ON?)''
Once the Citizen fires a rocket at the Chopper, and hits it, the Chopper will break apart 0.25 seconds later. Remove this behavior for the normal effect; it will take around 20 rockets to destroy it. ''(Porter's note: Exactly what difficulty setting are you ON?)''
Line 55: Line 59:
Notice that all of the work is done from this one trigger. The key is getting the timing right. By adding a few scripted sequences this scene could really come to life.
Notice that all of the work is done from this one trigger. The key is getting the timing right. By adding a few scripted sequences this scene could really come to life.


==See Also==
==See also==
*[http://type3studios.com/downloads/tutorials/SdkNutsTutorials/wiseNPC06.zip Example VMF]
*[http://type3studios.com/downloads/tutorials/SdkNutsTutorials/wiseNPC06.zip Example VMF]
*[https://cdn.discordapp.com/attachments/434089157875466242/463950681808699402/wiseNPC06.vmf Example VMF backup]
*[https://cdn.discordapp.com/attachments/434089157875466242/463950681808699402/wiseNPC06.vmf Example VMF backup]

Latest revision as of 09:28, 16 April 2024


This tutorial was originally created by wisemx. It was originally posted on SDKnuts.net.


Introduction

Events in this project:

  1. Helicopter takes off.
  2. Begins patrol of the area.
  3. Drops a single bomb.
  4. Begins shooting at Rebel Citizen.
  5. Citizen fires Rocket and destroys Chopper.

From my experience npc_helicopter takes trial and error to get it performing the way you want. On the other hand it’s loaded with options. With its extensive IO commands you have a lot of control over this beast. Experiment with the sample file below, add more inputs for it, get it to make a bombing run, etc.

Navigation for the npc_helicopter is done with path_track and info_node_air entities. It has a nice AI system that will allow it to patrol the area where you place these entities. Navigation for the npc_citizen is done by placing info_node entities on the ground. Some of the aspects of the Chopper that I don’t cover in this project are the avoidance and target systems you can use.

Creation

In this project I simply added one path_track gave it a name and then with it selected held Shift and I would drag a clone to a new location. The process was repeated until all four were created then for the forth I added the name of the first path_track as its Next Stop Target. The whole process only takes a few seconds. The info_node_air entities are placed randomly around the map to give the Chopper a running path away from the tracks. It will drift along the combination of these entities.

These are the properties for each of the entities used in this project.

npc_helicopter:

  • Name: heli01
  • Flags: Loud Rotor wash sound, Helicopter lights, More aggressive attacks, Await input, Fall to ground, Long Visibility
  My Output Target Entity Target Input Parameter Delay Only Once
Io11.png OnDamaged heli01 Break 0.25 Yes

Once the Citizen fires a rocket at the Chopper, and hits it, the Chopper will break apart 0.25 seconds later. Remove this behavior for the normal effect; it will take around 20 rockets to destroy it. (Porter's note: Exactly what difficulty setting are you ON?)

npc_citizen:

  • Name: cit01
  • Damage filter: damagefilter1
  • Weapons: RPG
  • Type: Rebel
  • Model: Female 1
  • Flags: Random Head, Not commandable, Random female head, Fall to ground, Long Visibility, Fade corpse

By adding this damage filter the Chopper will not be able to hurt our Citizen.

  • Class: filter_damage_type
  • Name: damagefilter1
  • Filter mode: Allow entities that match criteria
  • Damage type: GENERIC

Each of the key players in this project has an ai_relationship.

  • Name: ai01, ai02 and ai03
  • Subject: cit01, heli01 and heli01
  • Target: heli01, cit01 and !player
  • Disposition: Hate, Like and Neutral
  • Radius for subject: 0
  • Disposition priority: 100, 5 and 5
  • Start active: No, Yes and Yes
  • Reciprocal: No

To start all of the events a trigger_once is placed where the Player will spawn. (Porter's note: Uh. logic_auto?)

WiseNPC06 trigger o.png

Notice that all of the work is done from this one trigger. The key is getting the timing right. By adding a few scripted sequences this scene could really come to life.

See also