Generic Keyvalues, Inputs and Outputs/Keyvalues

From Valve Developer Community
< Generic Keyvalues, Inputs and Outputs
Revision as of 10:48, 18 July 2018 by Pinsplash (talk | contribs) (Pinsplash moved page KV BaseEntity to Template:KV BaseEntity: this is a template)
Jump to navigation Jump to search
Name ([todo internal name (i)]) <string>
The targetname that other entities refer to this entity by.
Entity Scripts ([todo internal name (i)]) <scriptlist> (in all games since Left 4 Dead 2)
Space delimited list of VScript files (without file extension) that are executed after all entities have spawned. The scripts are all executed in the same script scope, later ones overwriting any identical variables and functions.
Script think function ([todo internal name (i)]) <string> (in all games since Left 4 Dead 2)
Name of a function in this entity's script which will be called automatically every 100 milliseconds (ten times a second) for the duration of the script. It can be used to create timers or to simulate autonomous behavior. The return value (if present) will set the time until the next call.
Note.pngNote:Try to avoid expensive operations in this function, as it may cause performance problems.
Global Entity Name ([todo internal name (i)]) <string>
Name by which this entity is linked to another entity in a different map. When the player transitions to a new map, entities in the new map with globalnames matching entities in the previous map will have the previous map's state copied over their state.
Parent ([todo internal name (i)]) <targetname>
Specifies a movement parent. An entity will maintain its initial offset from its parent. An attachment point can be added to the end of the name, separated by a comma.
Note.pngNote:Every entity can be parented, even point entities. Some entities which aren't intended to be parented may not function correctly. phys_constraint can be used as a workaround to parenting.
Origin (X Y Z) ([todo internal name (i)]) <origin>
The position of this entity's center in the world. Rotating entities typically rotate around their origin.
Pitch Yaw Roll (Y Z X) ([todo internal name (i)]) <angle>
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.
Note.pngNote:This works on brush entities, although the result is only clear in-game.
HammerID ([todo internal name (i)]) <string>
The entity's Hammer ID. Mainly used by plugins and debugging commands, such as ent_keyvalue. !FGD
Effects ([todo internal name (i)]) <string>
Effect flags. !FGD
Response Contexts ([todo internal name (i)]) <string>
Pre-defined response system contexts for this entity. Format is key:value,key:value,...
Note.pngNote:Despite the description, this works for all entities, although it is missing from most entities in the FGD.
Lag Compensation ([todo internal name (i)]) <boolean> (in all games since Alien Swarm)
Set to Yes to lag compensate this entity. Should be used very sparingly!