Template:KV BaseNPC: Difference between revisions

From Valve Developer Community
Jump to navigation Jump to search
m (Added to Keyvalue Templates category)
m (Fix internal names)
Line 9: Line 9:
:* <code>D_NU</code>: Neutral
:* <code>D_NU</code>: Neutral


{{KV|Target Path Corner (target)|targetname|The [[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 (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 (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 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 (hintlimiting)|bool|Limits NPC to using specified hint group for navigation requests, but 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 (sleepstate)|choices|Holds the NPC in stasis until specified condition. See also 'Wake Radius' and 'Wake Squad'.
{{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 21:
:* 5: Auto PVS after PVS
:* 5: Auto PVS after PVS
}}
}}
{{KV|Wake Radius (wakeradius)|float|Auto-wake if player within this distance}}
{{KV|Wake Radius|intn=wakeradius|float|Auto-wake if player within this distance}}
{{KV|Wake Squad (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 (enemyfilter)|targetname|[[Filter]] entity to test targets against}}
{{KV|Enemy Filter|intn=enemyfilter|targetname|[[Filter]] entity to test targets against}}
{{KV|Ignore unseen enemies (ignoreunseenenemies)|bool|Prefer 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 (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}}
{{KV DamageFilter}}
{{KV ResponseContext}}
{{KV ResponseContext}}

Revision as of 03:03, 18 March 2021

BaseNPC:
Relationship ([todo internal name (i)]) <string> !FGD
<string|targetname or classname> <string|disposition> <int|rank>

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 FGDs.

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, but 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 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>
Prefer 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.

DamageFilter:

Damage Filter (damagefilter) <targetname>
Name of the filter_damage_type entity that controls which entities can damage us.
ResponseContext:
Response Contexts (ResponseContext) <string>
Pre-defined response system context{s} for this entity. Format is key:value,key:value,... When this entity speaks, the list of keys & values will be passed to the response rules system.

Shadow:

Disable Shadows (disableshadows) <boolean>
Prevents the entity from creating cheap render-to-texture shadows, or lightmap shadows if the entity is a prop_static. Does not affect shadow mapping.
Disable Receiving Shadows (disablereceiveshadows) <boolean>
Prevent the entity from receiving dynamic shadows on itself.
Shadow Cast Distance (shadowcastdist) <integer> !FGD
Sets how far the entity casts dynamic shadows. 0 means default distance from the shadow_control entity.
Disable Shadow Depth (disableshadowdepth) <boolean> (in all games since Portal 2)
Used to disable rendering into shadow depth (for projected textures) for this entity.
Disable flashlight (disableflashlight) <boolean> (in all games since Portal 2)
Used to disable projected texture lighting and shadows on this entity.
Projected Texture Cache (shadowdepthnocache) <integer choices> (in all games since Portal 2)
Used to hint projected texture system whether it is sufficient to cache shadow volume of this entity or to force render it every frame instead.
Choices
  • 0 : Default
  • 1 : No cache - render every frame
  • 2 : Cache it - render only once

RenderFields:


Render Mode (rendermode) <byte choices>
Set a non-standard rendering mode on this entity.
Render Modes
  • 0: Normal
  • 1: Color
  • 2: Texture
  • 3: Glow
  • 4: Solid/Alphatest Obsolete
  • 5: Additive
  • 6: Removed, does nothing Obsolete
  • 7: Additive Fractional Frame
  • 8: Alpha Add
  • 9: World Space Glow
  • 10: Don't Render
Render FX (renderfx) <byte choices>
Various somewhat legacy alpha effects. See render effects.
Render Amount / Transparency (renderamt) <byte>
Transparency amount, requires a Render Mode other than Normal. 0 is invisible, 255 is fully visible.
Render Color (R G B) (rendercolor) <color255>
Color tint.
Pitch Yaw Roll (Y Z X) (angles) <QAngle>
This entity's orientation in the world. Pitch is rotation around the Y axis, yaw is the rotation around the Z axis, roll is the rotation around the X axis.
Name (targetname) <string>[ Edit ]
The name that other entities refer to this entity by, via Inputs/Outputs or other keyvalues (e.g. parentname or target).
Also displayed in Hammer's 2D views and Entity Report.
See also:  Generic Keyvalues, Inputs and Outputs available to all entities

GMODSandbox:

Allow Physics Gun (gmod_allowphysgun) <boolean> (only in Garry's Mod)
If set, players cannot use Physics Gun on this entity.
Sandbox Tool Whitelist (gmod_allowtools) <string> (only in Garry's Mod)
If set, only given tools can be used on this entity. You need to supply the tool class names, the names of the .lua files of those tools. This also includes the context menu properties!