Difference between revisions of "Template:KV"

From Valve Developer Community
Jump to: navigation, search
m (Lang template)
(Added internal name parameters)
 
Line 1: Line 1:
 
<noinclude>
 
<noinclude>
 
{{lang|Template:KV}}
 
{{lang|Template:KV}}
This template is used to generate Keyvalue definitions on entity pages.
+
This template is used to generate [[Keyvalue]] definitions on entity pages.
  
 
== Basic usage ==
 
== Basic usage ==
Line 12: Line 12:
 
! Parameter || Description || Example || Preview
 
! Parameter || Description || Example || Preview
 
|-
 
|-
| <code>deprecated</code> || This Keyvalue is deprecated and should no longer be used. || <code><nowiki>{{KV|I'm deprecated|string|Really, don't use me anymore!|deprecated=1}}</nowiki></code> || {{KV|I'm deprecated|string|Really, don't use me anymore!|deprecated=1}}
+
| <code>deprecated</code> || This Keyvalue is deprecated and should no longer be used. || <code><nowiki>{{KV|I'm deprecated|intn=deprecated|string|Really, don't use me anymore!|deprecated=1}}</nowiki></code> || {{KV|I'm deprecated|intn=deprecated|string|Really, don't use me anymore!|deprecated=1}}
 
|-
 
|-
| <code>nofgd</code> || This Keyvalue isn't available in the official FGD. || <code><nowiki>{{KV|Add me to the FGD|boolean|Because I'm not there!|nofgd=1}}</nowiki></code> || {{KV|Add me to the FGD|boolean|Because I'm not there!|nofgd=1}}
+
| <code>nofgd</code> || This Keyvalue isn't available in the official FGD. || <code><nowiki>{{KV|Add me to the FGD|intn=addfgd|boolean|Because I'm not there!|nofgd=1}}</nowiki></code> || {{KV|Add me to the FGD|intn=addfgd|boolean|Because I'm not there!|nofgd=1}}
 
|-
 
|-
| <code>since</code> || This Keyvalue is available since this game. Uses the template <nowiki>{{<game> add}}</nowiki>. || <code><nowiki>{{KV|I like Alien Swarm|integer|I'm available in Portal 2, too!|since=AS}}</nowiki></code> || {{KV|I like Alien Swarm|integer|I'm available in Portal 2, too!|since=AS}}
+
| <code>intn</code> || The internal/engine name for this Keyvalue. || <code><nowiki>{{KV|Name|intn=targetname|string|The name that other entities refer to this entity by.}}</nowiki></code> || {{KV|Name|intn=targetname|string|The name that other entities refer to this entity by.}}
 
|-
 
|-
| <code>also</code> || This Keyvalue is also available in this game. Uses the template <nowiki>{{<game> also}}</nowiki>. || <code><nowiki>{{KV|I like Alien Swarm|integer|I'm also available in Garry's Mod!|since=AS|also=GMOD}}</nowiki></code> || {{KV|I like Alien Swarm|integer|I'm also available in Garry's Mod!|since=AS|also=GMOD}}
+
| <code>since</code> || This Keyvalue is available since this game. Uses the template <nowiki>{{<game> add}}</nowiki>. || <code><nowiki>{{KV|I like Alien Swarm|intn=likealienswarm|bool|I'm available in Portal 2, too!|since=AS}}</nowiki></code> || {{KV|I like Alien Swarm|intn=likealienswarm|bool|I'm available in Portal 2, too!|since=AS}}
 
|-
 
|-
| <code>only</code> || This Keyvalue is available only in this game. Uses the template <nowiki>{{<game> only}}</nowiki>. || <code><nowiki>{{KV|I love Alien Swarm|integer|I'm only available in Alien Swarm!|only=AS}}</nowiki></code> || {{KV|I love Alien Swarm|integer|I'm only available in Alien Swarm!|only=AS}}
+
| <code>also</code> || This Keyvalue is also available in this game. Uses the template <nowiki>{{<game> also}}</nowiki>. || <code><nowiki>{{KV|I like Alien Swarm|intn=likealienswarm|bool|I'm also available in Garry's Mod!|since=AS|also=GMOD}}</nowiki></code> || {{KV|I like Alien Swarm|intn=likealienswarm|bool|I'm also available in Garry's Mod!|since=AS|also=GMOD}}
 
|-
 
|-
| <code>to</code> || Use this to define a set of Keyvalues with very similar names. || <code><nowiki>{{KV|Sound 01|to=Sound 24|string|There are many of us...}}</nowiki></code> || {{KV|Sound 01|to=Sound 24|string|There are many of us...}}
+
| <code>only</code> || This Keyvalue is available only in this game. Uses the template <nowiki>{{<game> only}}</nowiki>. || <code><nowiki>{{KV|I love Alien Swarm|intn=lovealienswarm|integer|I'm only available in Alien Swarm!|only=AS}}</nowiki></code> || {{KV|I love Alien Swarm|intn=lovealienswarm|integer|I'm only available in Alien Swarm!|only=AS}}
 +
|-
 +
| <code>to</code> || Use this to define a set of Keyvalues with very similar names. Use <code>intn2</code> for the second keyvalue's internal name. || <code><nowiki>{{KV|Sound 01|intn=Sound01|to=Sound 24|intn2=Sound24|string|There are many of us...}}</nowiki></code> || {{KV|Sound 01|intn=Sound01|to=Sound 24|intn2=Sound24|string|There are many of us...}}
 
|}
 
|}
  
Line 30: Line 32:
  
 
<hr>
 
<hr>
</noinclude>; {{#if: {{{deprecated|}}} | <del> }}{{{1}}} {{#if: {{{to|}}} | <span style="font-weight: normal;">to</span> {{{to}}} }} {{#if: {{{2|}}} | {{KV Type|{{{2}}}}} }}{{#if: {{{deprecated|}}} | </del> }}{{#if: {{{since|}}} | &nbsp;{{{{{since}}} add}} }}{{#if: {{{only|}}} | &nbsp;{{{{{only}}} only}} }}{{#if: {{{also|}}} | &nbsp;{{{{{also}}} also}} }}{{#if: {{{nofgd|}}} | &nbsp;{{Not in FGD}} }}{{#if: {{{deprecated|}}} | &nbsp;{{obs}} }}
+
</noinclude>; {{#if: {{{deprecated|}}} | <del> }}{{{1}}} {{#if: {{{intn|}}} | <span style="font-weight: normal;"><code>{{Hover info|dotted=no|The internal name for this keyvalue; this is what the engine knows this keyvalue as. These display in Hammer for keyvalues when SmartEdit is disabled, or for keyvalues not in the FGD.|({{{intn}}})}}</code></span> }} {{#if: {{{to|}}}{{{intn2|}}} | <span style="font-weight: normal;">to</span> {{{to}}}{{#if:{{{intn2|}}} | &nbsp;<span style="font-weight: normal;"><code>{{Hover info|dotted=no|The internal name for this keyvalue; this is what the engine knows this keyvalue as. These display in Hammer for keyvalues when SmartEdit is disabled, or for keyvalues not in the FGD.|({{{intn2}}})}}</code></span>}} }} {{#if: {{{2|}}} | {{KV Type|{{{2}}}}} }}{{#if: {{{deprecated|}}} | </del> }}{{#if: {{{since|}}} | &nbsp;{{{{{since}}} add}} }}{{#if: {{{only|}}} | &nbsp;{{{{{only}}} only}} }}{{#if: {{{also|}}} | &nbsp;{{{{{also}}} also}} }}{{#if: {{{nofgd|}}} | &nbsp;{{Not in FGD}} }}{{#if: {{{deprecated|}}} | &nbsp;{{obs}} }}
 
: {{#if: {{{deprecated|}}} | Deprecated.&nbsp; }}{{#if: {{{3|}}} | {{{3}}}}}<noinclude>
 
: {{#if: {{{deprecated|}}} | Deprecated.&nbsp; }}{{#if: {{{3|}}} | {{{3}}}}}<noinclude>
 
[[Category:FGD Templates]]
 
[[Category:FGD Templates]]
 
</noinclude>
 
</noinclude>

Latest revision as of 00:13, 15 January 2020

Deutsch Français Русский 简体中文 

This template is used to generate Keyvalue definitions on entity pages.

Basic usage

{{KV|<name>|<variable type>|<description>}}

Note:Don't forget to use Template:= to escape any "=" characters in the text.

Named parameters

Parameter Description Example Preview
deprecated This Keyvalue is deprecated and should no longer be used. {{KV|I'm deprecated|intn=deprecated|string|Really, don't use me anymore!|deprecated=1}}
I'm deprecated (deprecated) <string> <Obsolete>
Deprecated. Really, don't use me anymore!
nofgd This Keyvalue isn't available in the official FGD. {{KV|Add me to the FGD|intn=addfgd|boolean|Because I'm not there!|nofgd=1}}
Add me to the FGD (addfgd) <boolean> !FGD
Because I'm not there!
intn The internal/engine name for this Keyvalue. {{KV|Name|intn=targetname|string|The name that other entities refer to this entity by.}}
Name (targetname) <string>
The name that other entities refer to this entity by.
since This Keyvalue is available since this game. Uses the template {{<game> add}}. {{KV|I like Alien Swarm|intn=likealienswarm|bool|I'm available in Portal 2, too!|since=AS}}
I like Alien Swarm (likealienswarm) <boolean> (New with Alien Swarm)
I'm available in Portal 2, too!
also This Keyvalue is also available in this game. Uses the template {{<game> also}}. {{KV|I like Alien Swarm|intn=likealienswarm|bool|I'm also available in Garry's Mod!|since=AS|also=GMOD}}
I like Alien Swarm (likealienswarm) <boolean> (New with Alien Swarm) (Also in Garry's Mod)
I'm also available in Garry's Mod!
only This Keyvalue is available only in this game. Uses the template {{<game> only}}. {{KV|I love Alien Swarm|intn=lovealienswarm|integer|I'm only available in Alien Swarm!|only=AS}}
I love Alien Swarm (lovealienswarm) <integer> (Only in Alien Swarm)
I'm only available in Alien Swarm!
to Use this to define a set of Keyvalues with very similar names. Use intn2 for the second keyvalue's internal name. {{KV|Sound 01|intn=Sound01|to=Sound 24|intn2=Sound24|string|There are many of us...}}
Sound 01 (Sound01) to Sound 24 (Sound24) <string>
There are many of us...

See also


{{{1}}}