Difference between revisions of "Template:KV BaseEntity"

From Valve Developer Community
Jump to: navigation, search
(template code mini cleanup, guess base is obsolete for the moment..)
(removed TeamNum, and brought back the template's quirk to show all keys if no params are defined)
Line 1: Line 1:
<noinclude>{{lang|Template:KV BaseEntity}}
+
<includeonly>
__NOTOC__
 
This template is our holder for all [[keyvalues]] that are assigned through {{ent|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.
 
<pre>{{KV BaseEntity}}</pre>
 
'''Base:''' display keyvalues that have only existed since whatever game added the class (most have existed since HL2, the first Source game).
 
<pre>{{KV BaseEntity|base=1}}</pre>
 
'''Game as a parameter:''' display the keyvalues that <code>base</code> 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. <code>l4d2</code> will not automatically include <code>l4d</code> keyvalues as well). This is because there are situations like in Portal 2, where the output <code>OnKilled</code> is not available through <code>CBaseEntity</code>, despite being a far descendant of the L4D branch which added it.
 
<pre>{{KV BaseEntity|l4d2=1}}</pre>
 
 
 
All parameters for this template:
 
*<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>l4d2</code>
 
*<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>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.
 
{{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|Some <code>CBaseEntity</code> keyvalues are not covered here. See the talk page.}}
 
----
 
[[Category:Keyvalue Templates|Global]]
 
{{KV BaseEntity}}
 
</noinclude><includeonly>
 
 
<!--
 
<!--
 
   ++ BRUSH ++
 
   ++ BRUSH ++
Line 56: Line 32:
 
{{KV|[[ResponseContext|Response Contexts]]|intn=ResponseContext|string|Pre-defined response system contexts for this entity. Format is <code>key:value,key:value,...</code>. Contexts may be [[filter_activator_context|filtered]].}}
 
{{KV|[[ResponseContext|Response Contexts]]|intn=ResponseContext|string|Pre-defined response system contexts for this entity. Format is <code>key:value,key:value,...</code>. Contexts may be [[filter_activator_context|filtered]].}}
 
{{KV|[[Effect flags|Effects]]|intn=effects|int|Combination of effect flags to use.|nofgd=1}}
 
{{KV|[[Effect flags|Effects]]|intn=effects|int|Combination of effect flags to use.|nofgd=1}}
 +
<!-- I'm not sure what the use cases of these 2 are, so ill hide them for now. Not too much of a harm to show "hammerid" for the plugin / sourcepawn peeps
 
{{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}}
 
<!--
 
<!--
   ++ Game Specifics - L4D2 ++
+
   ++ Game Specifics ++
 
-->
 
-->
<!-- IF NOT: BASE -->
+
<!-- IF NOT: BASE, L4D2 AND CSGO -->
{{#if:{{{base|}}}||{{#if:{{{l4d2|}}}| <!-- ...THEN IF: L4D2 -->
+
{{#if:{{{base|}}}||{{#if:{{{l4d2|}}}|
 
{{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|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|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}}
| }}<!-- ...THEN IF: CSGO --> {{#if:{{{csgo|}}}|
+
| <!-- ELSE 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}}
 
{{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}}
| }}}}
+
|<!-- ELSE: -->
<!--
+
{{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}}
  ++ TeamNum related things go here ++
+
{{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: TF2 == 'teamnum_dont_put_nofgd' -->
+
{{KV|[[Lag Compensation]]|intn=LagCompensate|boolean|Set to '''Yes''' to lag compensate this entity. Should be used very sparingly!|nofgd=1|since=L4D2}}
{{#switch: {{{tf2|}}} | teamnum_dont_put_nofgd =
+
}}}}}}</includeonly>
{{KV|Initial |choices|intn=teamnum|Which Team the entity belongs / is assigned to on spawn.
+
<noinclude>
:*0: None
+
{{documentation}}
:*1: Spectator
+
<!-- Add categories to the /doc subpage, not here -->
:*2: Red {{tf2}}
+
</noinclude>
:*3: Blue {{tf2}}
 
}} | <!-- ELSE IF : TF2 > 1 -->  1 =
 
{{KV|Initial Team|choices|intn=teamnum|Which Team the entity belongs / is assigned to on spawn.
 
:*0: None
 
:*1: Spectator
 
:*2: Red {{tf2}}
 
:*3: Blue {{tf2}}
 
|nofgd=1}}
 
| }} <!-- 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}}.
 
{{confirm|Does this work in {{css}}?}}
 
<!-- :*2: Survivors {{l4ds}}, Counter-Terrorist {{css}}:*3: Infected {{l4ds}} Terrorist {{css}} -->
 
|nofgd=1|deprecated=1}}
 
| }} <!-- IF: 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.
 
:*0: None
 
:*1: Spectator
 
:*2: Terrorists {{csgo}}
 
:*3: Counter-Terrorists {{csgo}}
 
}} | <!-- ELSE IF : CSGO == 1 --> {{#ifeq: {{{csgo|}}} | 1 |
 
{{KV|Initial Team|choices|intn=TeamNum|Which Team the entity belongs / is assigned to on spawn.
 
:*0: None
 
:*1: Spectator
 
:*2: Terrorists {{csgo}}
 
:*3: Counter-Terrorists {{csgo}}
 
|nofgd=1 }}
 
| }}}}</includeonly>
 

Revision as of 22:19, 19 April 2021


Template icon Template documentation[view] [edit] [history] [purge]

Info holder of all relevant keyvalues inheriting theCBaseEntity C++ class. Template parameters are vital in displaying the appropiate info, because new games have added new features throughout the years. See Help:Templates for more info on named parameters.

Not allCBaseEntitykeyvalues are not covered here. But you can see them all at the Uncovered Keyvalues page.

Note.png Note: After you edit this template, please make sure you also edit the targetted entity's page. Per-game keyvalues may be duplicated, for technical reasons. See also FGD Template Prototype.

Usage

These must be used in a specific syntax! - ALL parameters must be given a value of 1, like:l4d2=1. Only one game parameter can be used at once.

{{KV BaseEntity|l4d2=1}}

Parameters

If you leave the parameter field empty (using no arguments), the template will automatically fallback to displaying keyvalues from the current default game.

All parameters for this template:

  • base- No game specific information are displayed, and base engine features only. (The <Source><Source> / <Source><Source><Source> iteration engine)
  • l4d2- Set template KVs specific to <Left 4 Dead 2> (VScripts)
  • csgo- [CURRENT DEFAULT] Set template KVs specific to Counter-Strike: Global Offensive (VScripts + Auto-aim targets)
  • brush- Additionaly includes info specific to all sorts of brushes. For extra keys applicable only to visible brushes, use Template:KV visiblebrush in conjunction. Can be used along a game parameter.
Show Deprecated:


Refer to the Examples section for samples.

Examples

Show info specific to a game <Left 4 Dead 2>

This makes information relevant only to <Left 4 Dead 2> be displayed.

{{KV BaseEntity|l4d2=1}}
will:

Show info specific to base engine

Information relevant only to base engine are displayed. (<Source><Source> / <Source><Source><Source>)

{{KV BaseEntity|base=1}}
will:

Show extra info related to brushes

Extra brush related keyvalues are displayed with this.

{{KV BaseEntity|brush=1}}
will:

Using template defaults

Without using any arguments, the template fallbacks to a default, which is the latest Source game.

{{KV BaseEntity}}
will:


See Also