Template:KV BaseNPC: Difference between revisions

From Valve Developer Community
Jump to navigation Jump to search
m (Added {{lang}}.)
m (updated template usage.)
Line 1: Line 1:
<noinclude>{{lang|Template:KV BaseNPC}}
<noinclude>{{lang|Template:KV BaseNPC}}[[Category:Keyvalue Templates|BaseNPC]]
[[Category:Keyvalue Templates|BaseNPC]]</noinclude>
{{tip|Set {{param|branch}} to <tt>base</tt>, <tt>l4d</tt>, <tt>as</tt>, or <tt>portal2</tt> to exclude certain keyvalues. {{param|noscroll}} works.}}
{{ScrollBox|title=BaseNPC|
</noinclude>{{ScrollBox|title=BaseNPC|noscroll={{{noscroll|<noinclude>1</noinclude>}}}|
{{KV|Relationship|string|<[[string]]&#124;[[targetname]] or [[classname]]> <[[string]]&#124;disposition> <[[int]]&#124;rank>  
{{KV|Relationship|string| Changes whether this NPC likes or dislikes certain others. Used like the {{ent|ai_relationship}} entity, with this NPC as the subject. Format: <code><[[string]]{{!}}[[targetname]] or [[classname]]> <[[string]]{{!}}disposition> <[[int]]{{!}}rank></code>.
Changes whether this NPC likes or dislikes certain others. Used like the [[ai_relationship]] entity, with this NPC as the subject.
This keyvalue is not included in Valve's [[FGD]]s.|nofgd=1}}
: Values for <code>disposition</code> are:
: Values for <code>disposition</code> are:
:* <code>D_HT</code>: Hate
:* <code>D_HT</code>: Hate
:* <code>D_FR</code>: Fear
:* <code>D_FR</code>: Fear
:* <code>D_LI</code>: Like
:* <code>D_LI</code>: Like
:* <code>D_NU</code>: Neutral
:* <code>D_NU</code>: Neutral|nofgd=1}}
 
{{KV|Target Path Corner|intn=target|targetname|The {{ent|path_corner}} that this NPC will move to after spawning.}}
{{KV|Target Path Corner|intn=target|targetname|The [[path_corner]] that this NPC will move to after spawning.}}
{{KV|Squad Name|intn=squadname|string|NPCs that are in the same [[squads|squad]] (i.e., have matching squad names) will share information about enemies and will take turns attacking and covering each other.}}
{{KV|Squad Name|intn=squadname|string|NPCs that are in the same [[squads|squad]] (i.e. have matching squad names) will share information about enemies, and will take turns attacking and covering each other.}}
{{KV|Hint Group|intn=hintgroup|string|[[Hint Nodes#Hint Group|Hint groups]] are used by NPCs to restrict their hint-node searching to a subset of the map's hint nodes. Only hint nodes with matching hint group names will be considered by this NPC.}}
{{KV|Hint Group|intn=hintgroup|string|[[Hintgroup|Hint groups]] are used by NPCs to restrict their hint-node searching to a subset of the map's hint nodes. Only hint nodes with matching hint group names will be considered by this NPC.}}
{{KV|Hint Limit Nav|intn=hintlimiting|bool|Limits NPC to using specified hint group for navigation requests. Does not limit local navigation.}}
{{KV|Hint Limit Nav|intn=hintlimiting|bool|Limits NPC to using specified hint group for navigation requests, but does not limit local navigation.}}
{{KV|Sleep State|intn=sleepstate|choices|Holds the NPC in stasis until specified condition. See also <tt>Wake Radius</tt> and <tt>Wake Squad</tt>.
{{KV|Sleep State|intn=sleepstate|choices|Holds the NPC in stasis until specified condition. See also 'Wake Radius' and 'Wake Squad'.
:* 0: None
:* 0: None
:* 1: Waiting for threat
:* 1: Waiting for threat
Line 21: Line 18:
:* 3: Waiting for input, ignore PVS
:* 3: Waiting for input, ignore PVS
:* 4: Auto PVS
:* 4: Auto PVS
:* 5: Auto PVS after PVS
:* 5: Auto PVS after PVS}}
}}
{{KV|Wake Radius|intn=wakeradius|float|Auto-wake if player comes within this distance.}}
{{KV|Wake Radius|intn=wakeradius|float|Auto-wake if player within this distance}}
{{KV|Wake Squad|intn=wakesquad|bool|Wake all of the NPCs squadmates if the NPC is woken.}}
{{KV|Wake Squad|intn=wakesquad|bool|Wake all of the NPCs squadmates if the NPC is woken}}
{{KV|Enemy Filter|intn=enemyfilter|targetname|[[Filter]] entity to test targets against.}}
{{KV|Enemy Filter|intn=enemyfilter|targetname|[[Filter]] entity to test targets against}}
{{KV|Ignore unseen enemies|intn=ignoreunseenenemies|bool|Prefers visible enemies, regardless of distance or relationship priority.}}
{{KV|Ignore unseen enemies|intn=ignoreunseenenemies|bool|Prefer visible enemies, regardless of distance or relationship priority}}
{{KV|Physics Impact Damage Scale|intn=physdamagescale|float|Scales damage energy when this character is hit by a physics object. With a value of 0 the NPC will take no damage from physics.}}
{{KV|Physics Impact Damage Scale|intn=physdamagescale|float|Scales damage energy when this character is hit by a physics object. With a value of 0 the NPC will take no damage from physics.}}
{{KV DamageFilter}}
{{#switch: {{{game|}}}
{{KV ResponseContext}}
|base={{KV BaseEntity|noscroll=1|base=1}}
{{KV Shadow}}
{{KV BaseAnimating|noscroll=1|base=1}}
{{KV RenderFields}}
|l4d={{KV BaseEntity|noscroll=1|l4d2=1}}
{{KV Angles}}
{{KV BaseAnimating|noscroll=1|l4d2=1}}
{{KV Targetname}}
|as={{KV BaseEntity|noscroll=1|l4d2=1}}
{{KV GMOD}}
{{KV BaseAnimating|noscroll=1|as=1}}
}}
|portal2={{KV BaseEntity|noscroll=1|csgo=1}}
{{KV BaseAnimating|noscroll=1|portal2=1}}
|{{KV BaseEntity|noscroll=1}}
{{KV BaseAnimating|noscroll=1}}
{{KV DamageFilter}}}}

Revision as of 12:12, 26 May 2022

Tip.pngTip:Set {{{branch}}} to base, l4d, as, or portal2 to exclude certain keyvalues. {{{noscroll}}} works.

{{ScrollBox|title=BaseNPC|noscroll=1|

Relationship ([todo internal name (i)]) <string> !FGD
Changes whether this NPC likes or dislikes certain others. Used like the ai_relationship entity, with this NPC as the subject. Format: <string|targetname or classname> <string|disposition> <int|rank>.
Values for disposition are:
  • D_HT: Hate
  • D_FR: Fear
  • D_LI: Like
  • D_NU: Neutral
Target Path Corner (target) <targetname>
The path_corner that this NPC will move to after spawning.
Squad Name (squadname) <string>
NPCs that are in the same squad (i.e., have matching squad names) will share information about enemies and will take turns attacking and covering each other.
Hint Group (hintgroup) <string>
Hint groups are used by NPCs to restrict their hint-node searching to a subset of the map's hint nodes. Only hint nodes with matching hint group names will be considered by this NPC.
Hint Limit Nav (hintlimiting) <boolean>
Limits NPC to using specified hint group for navigation requests. Does not limit local navigation.
Sleep State (sleepstate) <choices>
Holds the NPC in stasis until specified condition. See also Wake Radius and Wake Squad.
  • 0: None
  • 1: Waiting for threat
  • 2: Waiting for PVS
  • 3: Waiting for input, ignore PVS
  • 4: Auto PVS
  • 5: Auto PVS after PVS
Wake Radius (wakeradius) <float>
Auto-wake if player comes within this distance.
Wake Squad (wakesquad) <boolean>
Wake all of the NPCs squadmates if the NPC is woken.
Enemy Filter (enemyfilter) <targetname>
Filter entity to test targets against.
Ignore unseen enemies (ignoreunseenenemies) <boolean>
Prefers visible enemies, regardless of distance or relationship priority.
Physics Impact Damage Scale (physdamagescale) <float>
Scales damage energy when this character is hit by a physics object. With a value of 0 the NPC will take no damage from physics.
Note.pngNote:Content moved to Rendering and studio model related KIO/Keyvalues for continuation of page history

DamageFilter:

Damage Filter (damagefilter) <targetname>
Name of the filter_damage_type entity that controls which entities can damage us.