Template:KV CAI BaseNPC: Difference between revisions

From Valve Developer Community
Jump to navigation Jump to search
(hintlimiting)
(intn for Source keyvalue templates)
 
(6 intermediate revisions by 2 users not shown)
Line 1: Line 1:
<noinclude>This template is our holder for all [[keyvalues]] that are assigned through {{ent|CAI_BaseNPC}}.
<noinclude>{{back|Template:KV_BaseCombatCharacter}}


Add <code>|as=1</code> for entities that include the new Alien Swarm keyvalues (HullType and BloodColor).
This template is our holder for all [[keyvalues]] that are assigned through {{ent|CAI_BaseNPC}}.


Add <code>|addeq=[text here]</code> to write a custom description for the '''Weapon Held''' keyvalue.
Add <code>|addeq=[text here]</code> to (optionally) write a custom description for the '''Weapon Held''' keyvalue.


For full documentation on this family of templates, see [[FGD Template Prototype]]. Still confused on something? '''Ask for help''' before editing this template.
{{note|Some <code>CBaseEntity</code> keyvalues are listed here for practical reasons.}}
{{note|Some <code>CBaseEntity</code> keyvalues are listed here. See the talk page.}}
----
----
[[Category:Keyvalue Templates|Global]]
[[Category:Keyvalue Templates|Global]]
</noinclude>
</noinclude>{{minititle|AI_BaseNPC}}
{{KV|Weapon Held (additionalequipment)|classname|{{{addeq|Gives the NPC a weapon. NPCs may attack oddly or not attack if they don't know how to use a particular weapon.}}}}}
{{KV|Weapon Held|intn=additionalequipment|classname|{{{addeq|Gives the NPC a weapon. NPCs may attack oddly or not attack if they don't know how to use a particular weapon.}}}}}
{{KV|Health (health)|integer|How close to death the NPC is.}}
{{KV|Health|intn=health|integer|How close to death the NPC is.|nofgd=1}}
{{KV|Maximum Health (max_health)|integer|'''Health''' cannot exceed this amount.}}
{{KV|Maximum Health|intn=max_health|integer|'''Health''' cannot exceed this amount.|nofgd=1}}
{{KV|[[Squad]] Name (squadname)|string|NPCs that are in the same squad 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 squad will share information about enemies, and will take turns attacking and covering each other.}}
{{KV|Relationship (Relationship)|string|<[[string]]&#124;[[targetname]] or [[classname]]> <[[string]]&#124;disposition> <[[int]]&#124;rank>
{{KV|Target Path Corner|intn=target|target_destination|If set, the name of a {{ent|path_corner}} entity that this NPC will move to, after spawning. Must be within 576 units from the NPC.}}
:Changes whether this NPC likes or dislikes certain others. Used like the {{ent|ai_relationship}} entity, with this NPC as the subject.
{{KV|Sleep State|intn=sleepstate|choices|Holds the NPC in stasis until specified condition. See also '''Wake Radius''' and '''Wake Squad'''.
:Values for <code>disposition</code> are:
:*<code>D_HT</code>: Hate
:*<code>D_FR</code>: Fear
:*<code>D_LI</code>: Like
:*<code>D_NU</code>: Neutral|nofgd=1}}
{{KV|Target Path Corner (target)|target_destination|If set, the name of a {{ent|path_corner}} entity that this NPC will move to, after spawning. Must be within 576 units from the NPC.}}
{{KV|Sleep State (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 31: Line 23:
:{{todo|clarify the differences between each}}
:{{todo|clarify the differences between each}}
}}
}}
{{KV|Wake Radius (wakeradius)|float|Auto-wake if player is within this distance, in Hammer units.}}
{{KV|Wake Radius|intn=wakeradius|float|Auto-wake if player is within this distance, in Hammer units.}}
{{KV|Wake Squad (wakesquad)|bool|If yes, wake all of the NPCs squadmates if the NPC is woken.}}
{{KV|Wake Squad|intn=wakesquad|bool|If yes, wake all of the NPCs squadmates if the NPC is woken.}}
{{KV|Ignore unseen enemies (ignoreunseenenemies)|choices|Prefer visible enemies, regardless of distance or relationship priority.}}
{{KV|Ignore unseen enemies|intn=ignoreunseenenemies|boolean|Prefer visible enemies, regardless of distance or relationship priority.}}
{{KV|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.}}
{{KV|[[hintgroup|Hint Group]]|intn=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.}}
{{KV|Hint Limit Nav (hintlimiting)|bool|If yes, limits NPC to using specified hint group for navigation requests, but does not limit local navigation.}}
{{KV|Hint Limit Nav|intn=hintlimiting|bool|If yes, limits NPC to using specified hint group for navigation requests, but does not limit local navigation.}}
{{KV|Enemy Filter (enemyfilter)|targetname|[[Filter]] by which to filter potential enemies.}}
{{KV|Enemy Filter|intn=enemyfilter|targetname|[[Filter]] by which to filter potential enemies.}}
{{KV|Physics Impact Damage Scale (physdamagescale)|float|Multiplier for damage amount when this NPC is hit by a physics object. With a value of 0 the NPC will take no damage from physics.}}
{{KV|Local [[Velocity]]|intn=velocity|vector|Velocity generated by the entity, can cause strange behavior if changed.|nofgd=1}}
{{KV|Local [[Velocity]] (velocity)|vector|Velocity generated by the entity, can cause strange behavior if changed.|nofgd=1}}
{{KV|Base [[Velocity]]|intn=basevelocity|vector|Velocity to start with on spawn.|nofgd=1}}
{{KV|Base [[Velocity]] (basevelocity)|vector|Velocity to start with on spawn.|nofgd=1}}
{{KV|Angular [[Velocity]]|intn=avelocity|vector|Angular velocity to start with on spawn.|nofgd=1}}
{{KV|Angular [[Velocity]] (avelocity)|vector|Angular velocity to start with on spawn.|nofgd=1}}
{{KV|Water Level|intn=waterlevel|character|Current water level of the entity, can cause strange behavior if changed.|nofgd=1}}
{{KV|Water Level (waterlevel)|character|Current water level of the entity, can cause strange behavior if changed.|nofgd=1}}
{{#if:{{{as|}}}|
{{KV|Hull Type (HullType)|integer|Physical size of the NPC. Affects navigation capabilities and the [[bounding box]].|nofgd=1|since=AS}}
:*<code>HUMAN_HULL</code>: Human
:*<code>WIDE_HUMAN_HULL</code>: Wide
:*<code>TINY_HULL</code>: Tiny
:*<code>MEDIUM_HULL</code>: Medium
:*<code>LARGE_HULL</code>: Large
{{confirm|Works? This keyvalue is defined as using integers}}
{{KV|Blood Color (BloodColor)|integer|Blood color of the NPC when shot.|nofgd=1|since=AS}}
{{confirm|Works? This keyvalue is defined as using integers}}
| }}<noinclude>
{{KV|Hull Type (HullType)|integer|Physical size of the NPC. Affects navigation capabilities and the [[bounding box]].|nofgd=1|since=AS}}
:*<code>HUMAN_HULL</code>: Human
:*<code>WIDE_HUMAN_HULL</code>: Wide
:*<code>TINY_HULL</code>: Tiny
:*<code>MEDIUM_HULL</code>: Medium
:*<code>LARGE_HULL</code>: Large
{{confirm|Works? This keyvalue is defined as using integers}}
{{KV|Blood Color (BloodColor)|integer|Blood color of the NPC when shot.|nofgd=1|since=AS}}
{{confirm|Works? This keyvalue is defined as using integers}}</noinclude>

Latest revision as of 13:25, 9 July 2024

Template:KV_BaseCombatCharacter

This template is our holder for all keyvalues that are assigned through CAI_BaseNPC.

Add |addeq=[text here] to (optionally) write a custom description for the Weapon Held keyvalue.

Note.pngNote:Some CBaseEntity keyvalues are listed here for practical reasons.

AI_BaseNPC:

Weapon Held (additionalequipment) <classname>
Gives the NPC a weapon. NPCs may attack oddly or not attack if they don't know how to use a particular weapon.
Health (health) <integer> !FGD
How close to death the NPC is.
Maximum Health (max_health) <integer> !FGD
Health cannot exceed this amount.
Squad Name (squadname) <string>
NPCs that are in the same squad will share information about enemies, and will take turns attacking and covering each other.
Target Path Corner (target) <targetname>
If set, the name of a path_corner entity that this NPC will move to, after spawning. Must be within 576 units from the NPC.
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
Todo: clarify the differences between each
Wake Radius (wakeradius) <float>
Auto-wake if player is within this distance, in Hammer units.
Wake Squad (wakesquad) <boolean>
If yes, wake all of the NPCs squadmates if the NPC is woken.
Ignore unseen enemies (ignoreunseenenemies) <boolean>
Prefer visible enemies, regardless of distance or relationship priority.
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>
If yes, limits NPC to using specified hint group for navigation requests, but does not limit local navigation.
Enemy Filter (enemyfilter) <targetname>
Filter by which to filter potential enemies.
Local Velocity (velocity) <vector> !FGD
Velocity generated by the entity, can cause strange behavior if changed.
Base Velocity (basevelocity) <vector> !FGD
Velocity to start with on spawn.
Angular Velocity (avelocity) <vector> !FGD
Angular velocity to start with on spawn.
Water Level (waterlevel) <character> !FGD
Current water level of the entity, can cause strange behavior if changed.