Template:KV BaseEntity/doc: Difference between revisions

From Valve Developer Community
Jump to navigation Jump to search
m (l4d param striked through, removed noinclude tag)
(Page makeover, can't be summarized here)
Line 1: Line 1:
{{Documentation subpage}}
{{Documentation subpage}}
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.
Info holder for all [[keyvalues]] that inherit the{{ent|CBaseEntity}} class. Parameters are vital to display the appropiate info, 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.
{{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. Also see [[FGD Template Prototype]].}}
<pre>{{KV BaseEntity}}</pre>
{{note|Some <code>CBaseEntity</code> keyvalues are not covered here. See the talk page.}}
'''Base:''' display keyvalues that have only existed since whatever game added the class (most have existed since HL2, the first Source game).
== Usage ==
<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 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>class, despite being a far descendant of the L4D branch which added it.
<pre>{{KV BaseEntity|l4d2=1}}</pre>
 
All parameters for this template:
All parameters for this template:
*<code>base</code> - (Use only the entity was available before L4D2.)
*<code>base</code> - Shows only information relevant to when it was initially added for the first time
*<code>l4d2</code> - When used, cannot show information for {{csgo}}unless you leave this and {{csgo}} as blank.
*<code>l4d2</code> - Include info specific to {{l4d2}} ([[VScript|VScripts]])
*<code>csgo</code> - {{l4d2}} must not be present if both {{l4d2}} and this must be shown at the same time.
*<code>csgo</code> - Include info specific to {{csgo}} (Auto-aim targets)
*<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>brush</code> - Include info specific to all sorts of brushes. For extra keys applicable ''only'' to visible brushes, use [[:Template:KV visiblebrush]] in conjunction.
*<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>
{{ExpandBox|nostarterlinebreak=1|
*<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.) (DEPRECATED 24/3/2021 was brought back for info specific to the<code>teamnum</code>key. Use {{tl|KV TeamNum}} instead.)</strike>
*<code>l4d</code> - <strike>(DEPRECATED 9/21/18: Found out these keyvalues only work with renderable things (cpu / gpu level). They have been migrated to visiblebrush and BaseAnimating KV templates. This is completely removed from the template and won't affect anything.)</strike>
*<code>l4d</code> - <strike>(DEPRECATED 9/21/18: Found out these keyvalues only work with renderable things (cpu / gpu level). They have been migrated to visiblebrush and BaseAnimating KV templates. This is completely removed from the template and won't affect anything.)</strike>
*<code>tf2</code> - <strike>(DEPRECATED 20/4/2021: Was only used to show <code>TeamNum</code>keyvalue's TF2 specific information. Use{{tl|KV TeamNum}}instead.)</strike>
*<code>tf2</code> - <strike>(DEPRECATED 20/4/2021: Was only used to show <code>TeamNum</code>keyvalue's TF2 specific information. Use {{tl|KV TeamNum}} instead.)</strike>
{{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.}}
| Show Deprecated: }}
See [[FGD Template Prototype]].
 
{{note|Some <code>CBaseEntity</code> keyvalues are not covered here. See the talk page.}}
These must be used in a specific syntax; All the parameters must be given a value of 1, like for example:<code>tf2=1</code>for {{tf2}} specific info. Refer to the [[#Examples|Examples]] section.
== Examples ==
=== Show info specific to a game {{csgo}} ===
This makes information relevant only to {{csgo}} be displayed.
<pre>{{KV BaseEntity|csgo=1}}</pre>
{{ExpandBox|nostarterlinebreak=1|
{{KV BaseEntity|csgo=1}}
|will:}}
=== Show info for its base ===
Information relevant only to this key at / before {{Ep2}} is displayed.
<pre>{{KV BaseEntity|base=1}}</pre>
{{ExpandBox|nostarterlinebreak=1|
{{KV BaseEntity|base=1}}
|will:}}
=== Show info related to brushes ===
Extra brush related keyvalues are displayed with this.
<pre>{{KV BaseEntity|brush=1}}</pre>
{{ExpandBox|nostarterlinebreak=1|
{{KV BaseEntity|brush=1}}
|will:}}
=== Show information for '''all''' games ===
Shows every game information for this key that this template can display. (Except for brush related)
<pre>{{KV BaseEntity}}</pre>
{{ExpandBox|nostarterlinebreak=1|
{{KV BaseEntity}}
|will:}}
----
----
{{KV BaseEntity}}
{{KV BaseEntity}}

Revision as of 11:29, 27 April 2021

Edit-copy.png
This is a documentation subpage for Template:KV BaseEntity.
Don't forget to purge the contents of the base page upon creating or editing this subpage.

Info holder for all keyvalues that inherit theCBaseEntity class. Parameters are vital to display the appropiate info, because new games have added new features throughout the years. See Help:Templates for more info on named parameters.

Note.pngNote: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. Also see FGD Template Prototype.
Note.pngNote:Some CBaseEntity keyvalues are not covered here. See the talk page.

Usage

All parameters for this template:

  • base - Shows only information relevant to when it was initially added for the first time
  • l4d2 - Include info specific to Left 4 Dead 2 (VScripts)
  • csgo - Include info specific to Counter-Strike: Global Offensive (Auto-aim targets)
  • brush - Include info specific to all sorts of brushes. For extra keys applicable only to visible brushes, use Template:KV visiblebrush in conjunction.
Show Deprecated:  
  • 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.) (DEPRECATED 24/3/2021 was brought back for info specific to theteamnumkey. Use {{KV TeamNum}} instead.)
  • l4d - (DEPRECATED 9/21/18: Found out these keyvalues only work with renderable things (cpu / gpu level). They have been migrated to visiblebrush and BaseAnimating KV templates. This is completely removed from the template and won't affect anything.)
  • tf2 - (DEPRECATED 20/4/2021: Was only used to show TeamNumkeyvalue's TF2 specific information. Use {{KV TeamNum}} instead.)

These must be used in a specific syntax; All the parameters must be given a value of 1, like for example:tf2=1for Team Fortress 2 specific info. Refer to the Examples section.

Examples

Show info specific to a game Counter-Strike: Global Offensive

This makes information relevant only to Counter-Strike: Global Offensive be displayed.

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

Show info for its base

Information relevant only to this key at / before Half-Life 2: Episode Two is displayed.

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

Show info related to brushes

Extra brush related keyvalues are displayed with this.

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

Show information for all games

Shows every game information for this key that this template can display. (Except for brush related)

{{KV BaseEntity}}
will: