Difference between revisions of "Template:KV BaseEntity"

From Valve Developer Community
Jump to: navigation, search
m (todo for css edited to proper formatting, i dont own css so i cant do anything abt it)
(template code mini cleanup, guess base is obsolete for the moment..)
Line 10: Line 10:
  
 
All parameters for this template:
 
All parameters for this template:
*<code>base</code> - (Use if the entity was available before L4D2.)
+
*<code>base</code> - (Use if the entity was available before L4D2.) (OBSOLETE 16/4/21: At the current moment, the script code for this template has been improved that, base does nothing notable as of the moment; It only prevents L4D2 and CSGO keys from appearing when this is used alongside both games's parameters.)
 
*<code>l4d</code> - (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.)
 
*<code>l4d</code> - (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.)
 
*<code>l4d2</code>
 
*<code>l4d2</code>
 
*<code>csgo</code> - When using this, Use<code>csgo=teamnum_dont_put_nofgd</code>to remove the {{Not in FGD}} tag.
 
*<code>csgo</code> - When using this, Use<code>csgo=teamnum_dont_put_nofgd</code>to remove the {{Not in FGD}} tag.
 
*<code>css</code> - <strike>(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.) (24/3/2021 brought back for the<code>teamnum</code> key)</strike>
 
*<code>css</code> - <strike>(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.) (24/3/2021 brought back for the<code>teamnum</code> key)</strike>
*<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 keys applicable only to visible brushes, use [[:Template:KV visiblebrush]] in conjunction.)
 
*<code>tf2</code> - Alter<code>TeamNum</code>keyvalue to show TF2 specific information. Use<code>tf2=teamnum_dont_put_nofgd</code>to remove the {{Not in FGD}} tag.
 
*<code>tf2</code> - Alter<code>TeamNum</code>keyvalue to show TF2 specific information. Use<code>tf2=teamnum_dont_put_nofgd</code>to remove the {{Not in FGD}} tag.
 
{{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.}}
Line 23: Line 23:
 
[[Category:Keyvalue Templates|Global]]
 
[[Category:Keyvalue Templates|Global]]
 
{{KV BaseEntity}}
 
{{KV BaseEntity}}
</noinclude><!--
+
</noinclude><includeonly>
--><includeonly>{{#if:{{{brush|}}}|{{minititle|Brush}}
+
<!--
{{KV|Minimum Bounding Box Size|intn=mins|vector|Starting at the brush's origin, draw a bounding box this large. All coords but Y will treat the origin as a midpoint. Can be used to overwrite the collision shape of a brush. Requires<code>maxs</code> if used so the other side of the box isn't empty.|nofgd=1}}
+
  ++ BRUSH ++
{{KV|Maximum Bounding Box Size|intn=maxs|vector|Starting at the brush's origin, draw a bounding box this large. All coords but Y will treat the origin as a midpoint. Can be used to overwrite the collision shape of a brush. Requires<code>mins</code> if used so the other side of the box isn't empty.|nofgd=1}}
+
-->
{{note|If you want to translate a brush's size in Hammer to these keys, divide the size value in Hammer by 2. Then, apply the resulting number to one of the 2 keys, with the other key's number inverted (Multiplied / Divided by -1).}}
+
<!-- IF: BRUSH -->
{{note|Requires collisions set to Bounding Box (solid 2).}}
+
{{#if:{{{brush|}}}|{{minititle|Brush}}
 +
{{KV|Minimum Bounding Box Size|intn=mins|vector|Starting at the brush's origin, draw a bounding box this large. Requires<code>maxs</code> if used so the other side of the box isn't empty.|nofgd=1}}
 +
{{KV|Maximum Bounding Box Size|intn=maxs|vector|Starting at the brush's origin, draw a bounding box this large. Requires<code>mins</code> if used so the other side of the box isn't empty.|nofgd=1}}
 +
{{note|To translate a brush's size in Hammer to these keys, first divide the size value in Hammer by 2. Then, apply the resulting number to one of the 2 keys, then have the numbers inverted for the other key (Multiplied / Divided by -1).}}
 +
{{note|If collisions is already set, it must be set back to Bounding Box (solid 2).}}
 +
{{confirm|Do all coordinates treat the origin as a "midpoint", and does it matter?}}
 
{{KV|Collisions|intn=solid|choices|Method of collision for this entity.|nofgd=1}}
 
{{KV|Collisions|intn=solid|choices|Method of collision for this entity.|nofgd=1}}
 
:*0: None
 
:*0: None
Line 34: Line 39:
 
:*2: [[Bounding box|Bounding Box]]
 
:*2: [[Bounding box|Bounding Box]]
 
:*3: [[Bounding box|Oriented Bounding Box]]
 
:*3: [[Bounding box|Oriented Bounding Box]]
:*4: [[Bounding box|Oriented Bounding Box]], constrained to Yaw only
+
:*4: [[Bounding box|Oriented Bounding Box]], constrained to [[QAngle|Yaw]] only
 
:*5: Custom/Test
 
:*5: Custom/Test
 
:*6: [[VPhysics]]
 
:*6: [[VPhysics]]
 
{{KV|Model Index|intn=modelindex|short|Changes the entity's model to a precached model on the map.|nofgd=1}}}}
 
{{KV|Model Index|intn=modelindex|short|Changes the entity's model to a precached model on the map.|nofgd=1}}}}
 +
<!--
 +
  ++ Base ++
 +
-->
 
{{minititle|Base}}
 
{{minititle|Base}}
 
{{KV|[[Classname]]|intn=classname|string|The classname defines the type of entity. Classnames can be changed using {{ent|AddOutput}}, which will influence how the engine deals with the entity in certain circumstances.}}
 
{{KV|[[Classname]]|intn=classname|string|The classname defines the type of entity. Classnames can be changed using {{ent|AddOutput}}, which will influence how the engine deals with the entity in certain circumstances.}}
Line 50: Line 58:
 
{{KV|Local Time|intn=ltime|float|The local time of the entity, independent of the global clock. Used mainly for physics calculations.|nofgd=1}}
 
{{KV|Local Time|intn=ltime|float|The local time of the entity, independent of the global clock. Used mainly for physics calculations.|nofgd=1}}
 
{{KV|Next Think|intn=nextthink|float|Amount of time before the entity [[Thinking|thinks]] again.|nofgd=1}}
 
{{KV|Next Think|intn=nextthink|float|Amount of time before the entity [[Thinking|thinks]] again.|nofgd=1}}
{{KV|Hammer ID|intn=hammerid|int|The entity's [[Hammer]] ID. Mainly used by plugins and debugging commands, such as '''<code>ent_keyvalue</code>'''. Can be manually assigned with the "hammerid" or "id" keyvalue. Entities spawned at run-time are not assigned any Hammer ID.|nofgd=1}}<!--
+
{{KV|Hammer ID|intn=hammerid|int|The entity's [[Hammer]] ID. Mainly used by plugins and debugging commands, such as '''<code>ent_keyvalue</code>'''. Can be manually assigned with the "hammerid" or "id" keyvalue. Entities spawned at run-time are not assigned any Hammer ID.|nofgd=1}}
-->{{#if:{{{l4d2|}}}|<!--
+
<!--
-->{{KV|Disable for Xbox 360|intn=disableX360|bool|If Yes, disables this entity on the Xbox 360 version of Source.|nofgd=1|since=L4D2}}
+
  ++ Game Specifics - L4D2 ++
{{KV|Entity Scripts|intn=vscripts|scriptlist|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.|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}}
+
<!-- IF NOT: BASE -->
{{KV|[[Lag Compensation]]|intn=LagCompensate|boolean|Set to '''Yes''' to lag compensate this entity. Should be used very sparingly!|nofgd=1|since=L4D2}}<!--
+
{{#if:{{{base|}}}||{{#if:{{{l4d2|}}}| <!-- ...THEN IF: L4D2 -->
-->| }}{{#if:{{{csgo|}}}|<!--
+
{{KV|Disable for Xbox 360|intn=disableX360|bool|If this entity should automatically be given the 'Disable' input on the Xbox 360 version of Source.|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}}<!--
 
-->| }}{{#if:{{{l4d2|}}}||{{#if:{{{csgo|}}}||{{#if:{{{base|}}}||<!--
 
-->{{KV|Disable for Xbox 360|intn=disableX360|bool|If Yes, disables this entity on the Xbox 360 version of Source.|nofgd=1|since=L4D2}}
 
 
{{KV|Entity Scripts|intn=vscripts|scriptlist|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.|since=L4D2}}
 
{{KV|Entity Scripts|intn=vscripts|scriptlist|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.|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|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}}}}}}<!--
+
| }}<!-- ...THEN IF: CSGO --> {{#if:{{{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}}
 +
| }}}}
 
<!--
 
<!--
 
   ++ TeamNum related things go here ++
 
   ++ TeamNum related things go here ++
Line 75: Line 81:
 
:*2: Red {{tf2}}
 
:*2: Red {{tf2}}
 
:*3: Blue {{tf2}}
 
:*3: Blue {{tf2}}
}} | <!-- ELSE IF : TF2 == 1 --> 1 =
+
}} | <!-- ELSE IF : TF2 > 1 --> 1 =
 
{{KV|Initial Team|choices|intn=teamnum|Which Team the entity belongs / is assigned to on spawn.
 
{{KV|Initial Team|choices|intn=teamnum|Which Team the entity belongs / is assigned to on spawn.
 
:*0: None
 
:*0: None
Line 82: Line 88:
 
:*3: Blue {{tf2}}
 
:*3: Blue {{tf2}}
 
|nofgd=1}}
 
|nofgd=1}}
| }} <!-- IF: CSS, ELSEIF: L4D, ELSEIF: L4D2 --> {{#if:{{{css|}}}||{{#if:{{{l4d|}}}||{{#if:{{{l4d2|}}}|
+
| }} <!-- IF: CSS OR L4D OR L4D2 --> {{#if:{{{css|}}}{{{l4d|}}}{{{l4d2|}}}|
 
{{KV|Initial Team|choices|intn=teamnum|Which Team the entity belongs / is assigned to on spawn. Doesn't do anything in {{l4ds}}.
 
{{KV|Initial Team|choices|intn=teamnum|Which Team the entity belongs / is assigned to on spawn. Doesn't do anything in {{l4ds}}.
:{{confirm|Does this work in {{css}}?}}
+
{{confirm|Does this work in {{css}}?}}
<!--
+
<!-- :*2: Survivors {{l4ds}}, Counter-Terrorist {{css}}:*3: Infected {{l4ds}} Terrorist {{css}} -->
:*0: None
 
:*1: Spectator
 
:*2: Survivors {{l4ds}}, Counter-Terrorist {{css}}
 
:*3: Infected {{l4ds}} Terrorist {{css}}
 
-->  
 
 
|nofgd=1|deprecated=1}}
 
|nofgd=1|deprecated=1}}
| }}}}}} <!-- IF: CSGO == 'teamnum_dont_put_nofgd' -->
+
| }} <!-- IF: CSGO == 'teamnum_dont_put_nofgd' -->
{{#switch: {{{csgo|}}} | teamnum_dont_put_nofgd =
+
{{#ifeq: {{{csgo|}}} | teamnum_dont_put_nofgd |
 
{{KV|Initial Team|choices|intn=TeamNum|Which Team the entity belongs / is assigned to on spawn.
 
{{KV|Initial Team|choices|intn=TeamNum|Which Team the entity belongs / is assigned to on spawn.
 
:*0: None
 
:*0: None
Line 99: Line 100:
 
:*2: Terrorists {{csgo}}
 
:*2: Terrorists {{csgo}}
 
:*3: Counter-Terrorists {{csgo}}
 
:*3: Counter-Terrorists {{csgo}}
}} | <!-- ELSE IF : CSGO == 1 --> 1 =
+
}} | <!-- ELSE IF : CSGO == 1 --> {{#ifeq: {{{csgo|}}} | 1 |
 
{{KV|Initial Team|choices|intn=TeamNum|Which Team the entity belongs / is assigned to on spawn.
 
{{KV|Initial Team|choices|intn=TeamNum|Which Team the entity belongs / is assigned to on spawn.
 
:*0: None
 
:*0: None
Line 106: Line 107:
 
:*3: Counter-Terrorists {{csgo}}
 
:*3: Counter-Terrorists {{csgo}}
 
|nofgd=1 }}
 
|nofgd=1 }}
| }}</includeonly>
+
| }}}}</includeonly>

Revision as of 02:51, 16 April 2021

 English Русский 简体中文 

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. No parameters: display keyvalues for ALL games.

{{KV BaseEntity}}

Base: display keyvalues that have only existed since whatever game added the class (most have existed since HL2, the first Source game).

{{KV BaseEntity|base=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.

{{KV BaseEntity|l4d2=1}}

All parameters for this template:

  • base - (Use if the entity was available before L4D2.) (OBSOLETE 16/4/21: At the current moment, the script code for this template has been improved that, base does nothing notable as of the moment; It only prevents L4D2 and CSGO keys from appearing when this is used alongside both games's parameters.)
  • 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 - When using this, Usecsgo=teamnum_dont_put_nofgdto remove the !FGD tag.
  • 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.) (24/3/2021 brought back for theteamnum key)
  • brush - (This adds things common for all brush entities, visible or not. For keys applicable only to visible brushes, use Template:KV visiblebrush in conjunction.)
  • tf2 - AlterTeamNumkeyvalue to show TF2 specific information. Usetf2=teamnum_dont_put_nofgdto remove the !FGD tag.
Note.png 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.

Note.png Note: Some 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.
Name (targetname) <string>
The name that other entities refer to this entity by.
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.png 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.
Effects (effects) <integer> !FGD
Combination of effect flags to use.
Hammer ID (hammerid) <integer> !FGD
The entity's Hammer ID. Mainly used by plugins and debugging commands, such as ent_keyvalue. Entities spawned at run-time are not assigned any Hammer ID.
Entity Scripts (vscripts) <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 (thinkfunction) <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. Try to avoid expensive operations in this function, as it may cause performance problems.
Lag Compensation (LagCompensate) <boolean> (in all games since <Left 4 Dead 2>) !FGD
Set to Yes to lag compensate this entity. Should be used very sparingly!
Disable for Xbox 360 (disableX360) <boolean> (in all games since <Left 4 Dead 2>) !FGD
If this entity should automatically be given the 'Disable' input on the Xbox 360 version of Source.
Is Automatic-Aim Target (is_autoaim_target) <boolean> (in all games since <Counter-Strike: Global Offensive>) !FGD
If set to 1, this entity will slow down aiming movement for consoles and joystick controllers when the entity is under the crosshairs.