Generic Keyvalues, Inputs and Outputs/Keyvalues: Difference between revisions
(changed ent_keyvalue to plain text. as 356 would have linked to a page of a cvar, which didn't exist. makign a page for a single cvar seemed silly.) |
m (Can someone supply more info about TeamNum from various source games, or at least hit me with the info) |
||
Line 16: | Line 16: | ||
*<code>css</code> (DEPRECATED 10/1/18: Previously used for a notice that was ''thought'' to apply to all entities in CS:S. The purpose of this now exists in [[Template:PreservedEnt]]. This is completely removed from the template and won't affect anything.) | *<code>css</code> (DEPRECATED 10/1/18: Previously used for a notice that was ''thought'' to apply to all entities in CS:S. The purpose of this now exists in [[Template:PreservedEnt]]. This is completely removed from the template and won't affect anything.) | ||
*<code>brush</code> (This adds things common for all brush entities, visible or not. For visible ones, use [[:Template:KV visiblebrush]] in conjunction.) | *<code>brush</code> (This adds things common for all brush entities, visible or not. For visible ones, use [[:Template:KV visiblebrush]] in conjunction.) | ||
*<code>tf2</code> Modifies the<code>TeamNum</code> keyvalue to show tf2 related info. | |||
{{note|If you want to edit something on this template, please make sure you edit it in both places. ''Per-game'' keyvalues are duplicated, for technical reasons.}} | {{note|If you want to edit something on this template, please make sure you edit it in both places. ''Per-game'' keyvalues are duplicated, for technical reasons.}} | ||
See [[FGD Template Prototype]]. | See [[FGD Template Prototype]]. | ||
Line 61: | Line 62: | ||
{{KV|Script think function|intn=thinkfunction|string|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. Try to avoid [[expensive]] operations in this function, as it may cause performance problems.|since=L4D2}} | {{KV|Script think function|intn=thinkfunction|string|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. Try to avoid [[expensive]] operations in this function, as it may cause performance problems.|since=L4D2}} | ||
{{KV|[[Lag Compensation]]|intn=LagCompensate|boolean|Set to '''Yes''' to lag compensate this entity. Should be used very sparingly!|nofgd=1|since=L4D2}} | {{KV|[[Lag Compensation]]|intn=LagCompensate|boolean|Set to '''Yes''' to lag compensate this entity. Should be used very sparingly!|nofgd=1|since=L4D2}} | ||
{{KV|Is Automatic-Aim Target|intn=is_autoaim_target|bool|If set to 1, this entity will slow down aiming movement for consoles and joystick controllers when the entity is under the crosshairs.|nofgd=1|since=CSGO}}}}}}}} | {{KV|Is Automatic-Aim Target|intn=is_autoaim_target|bool|If set to 1, this entity will slow down aiming movement for consoles and joystick controllers when the entity is under the crosshairs.|nofgd=1|since=CSGO}}}}}}<!-- | ||
-->| }}{{KV|Team|choices|intn=TeamNum|Which Team the entity belongs / is assigned to | |||
:*0: None | |||
:*1: Spectator<!-- | |||
--> {{#if:{{{tf2|}}}| | |||
:*2: Red {{tf2}} | |||
:*3: Blue {{tf2}} <!-- | |||
-->| }}<!-- | |||
--> {{#if:{{{l4d|}}}||{{#if:{{{l4d2|}}} | |||
:*2: Survivor {{l4ds}} | |||
:*3: Infected {{l4ds}} <!-- | |||
-->| }}}} | |||
|nofgd=1}} |
Revision as of 05:27, 24 March 2021
This template is our holder for all keyvalues that are assigned through CBaseEntity. The template has a very specific syntax that you must follow to apply properly, because new games have added new features throughout the years. See Help:Templates for more info on named parameters.
{{KV BaseEntity}}
No parameters: display keyvalues for ALL games.
{{KV BaseEntity|base=1}}
Base: display keyvalues that have only existed since whatever game added the class (most have existed since HL2, the first Source game).
{{KV BaseEntity|l4d2=1}}
Game as a parameter: display the keyvalues that base
displays, AND keyvalues that were added to the class, by the specified game. You can specify as many games as needed. You must specify ALL the games you want to include (e.g. l4d2
will not automatically include l4d
keyvalues as well). This is because there are situations like in Portal 2, where the output OnKilled
is not available through CBaseEntity
, despite being a far descendant of the L4D branch which added it.
All parameters for this template:
base
(Use if the entity was available before L4D2.)l4d
(DEPRECATED 9/21/18: Found out these keyvalues only work with renderable things. They have been migrated to visiblebrush and BaseAnimating KV templates. This is completely removed from the template and won't affect anything.)l4d2
csgo
css
(DEPRECATED 10/1/18: Previously used for a notice that was thought to apply to all entities in CS:S. The purpose of this now exists in Template:PreservedEnt. This is completely removed from the template and won't affect anything.)brush
(This adds things common for all brush entities, visible or not. For visible ones, use Template:KV visiblebrush in conjunction.)tf2
Modifies theTeamNum
keyvalue to show tf2 related info.


CBaseEntity
keyvalues are not covered here. See the talk page.Base:
- Classname (classname) <string>
- The classname defines the type of entity. Classnames can be changed using AddOutput, which will influence how the engine deals with the entity in certain circumstances.
- Global Entity Name (globalname) <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 (parentname) <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. Every entity can be parented, even point entities. Entities which are parented will be forced to transition to the next map, such as from a trigger_transition. 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) (origin) <coordinates>
- The position of this entity's center in the world. Rotating entities typically rotate around their origin.
- Pitch Yaw Roll (X Y Z) (angles) <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:This works on brush entities, although Hammer doesn't show the new angles.
- Flags (spawnflags) <integer>
- Toggles features of an entity, its specific number is determined by the combination of flags added.
- Response Contexts (ResponseContext) <string>
- Pre-defined response system contexts for this entity. Format is
key:value,key:value,...
. Contexts may be filtered.
- Local Time (ltime) <float> !FGD
- The local time of the entity, independent of the global clock. Used mainly for physics calculations.
- Hammer ID (hammerid) <integer> !FGD
- The entity's Hammer ID. Mainly used by plugins and debugging commands, such as
ent_keyvalue
. Can be manually assigned with the "hammerid" or "id" keyvalue. Entities spawned at run-time are not assigned any Hammer ID. - Disable for Xbox 360 (disableX360) <boolean> (in all games since
) !FGD
- If Yes, disables this entity on the Xbox 360 version of Source.
- Entity Scripts (vscripts) <scriptlist> (in all games since
)
- 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 (thinkfunction) <string> (in all games since
)
- 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. Try to avoid expensive operations in this function, as it may cause performance problems.
- Lag Compensation (LagCompensate) <boolean> (in all games since
) !FGD
- Set to Yes to lag compensate this entity. Should be used very sparingly!
- Is Automatic-Aim Target (is_autoaim_target) <boolean> (in all games since
) !FGD
- If set to 1, this entity will slow down aiming movement for consoles and joystick controllers when the entity is under the crosshairs.
- Team (TeamNum) <choices> !FGD
- Which Team the entity belongs / is assigned to
- 0: None
- 1: Spectator