Template:KeyValue: Difference between revisions
Jump to navigation
Jump to search
Note:Don't forget to use Template:= to escape any "=" characters in the text.
(Added support for Template:Since, etc. as an optional alternative to the "{{<branch> add}}"-type templates) |
(Added support for Template:Removed) |
||
Line 1: | Line 1: | ||
; {{#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|}}} | <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: {{{only|}}} | {{#ifexist: Template:{{{only}}} only | {{{{{only}}} only}} | {{only|{{{only}}}}}}} }}{{#if: {{{since|}}} | {{#ifexist: Template:{{{since}}} add | {{{{{since}}} add}} | {{since|{{{since}}}}}}} }}{{#if: {{{also|}}} | {{#ifexist: Template:{{{also}}} also | {{{{{also}}} also}} | {{also|{{{also}}}}}}} }}{{#if: {{{nofgd|}}} | {{Not in FGD}} }}{{#if: {{{deprecated|}}} | {{obs}} }} | ; {{#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|}}} | <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: {{{only|}}} | {{#ifexist: Template:{{{only}}} only | {{{{{only}}} only}} | {{only|{{{only}}}}}}} }}{{#if: {{{since|}}} | {{#ifexist: Template:{{{since}}} add | {{{{{since}}} add}} | {{since|{{{since}}}}}}} }}{{#if: {{{removed|}}} | {{removed|{{{removed}}}}} }}{{#if: {{{also|}}} | {{#ifexist: Template:{{{also}}} also | {{{{{also}}} also}} | {{also|{{{also}}}}}}} }}{{#if: {{{nofgd|}}} | {{Not in FGD}} }}{{#if: {{{deprecated|}}} | {{obs}} }} | ||
: {{#if: {{{deprecated|}}} | Deprecated. }}{{#if: {{{3|}}} | {{{3}}}}}<noinclude> | : {{#if: {{{deprecated|}}} | Deprecated. }}{{#if: {{{3|}}} | {{{3}}}}}<noinclude> | ||
{{documentation}} | {{documentation}} | ||
<!-- Add categories to the /doc subpage, not here --> | <!-- Add categories to the /doc subpage, not here --> | ||
</noinclude> | </noinclude> |
Revision as of 08:52, 8 May 2020
- {{{1}}}
This template is used to generate Keyvalue definitions on entity pages.
Usage
{{KV|<name>|<variable type>|<description>}}

Examples and 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}} |
|
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}} |
|
intn |
The internal/engine name for this Keyvalue. Required; if absent, the page will display green todo text and applies Category:Pages with undefined internal keyvalue names. You can look for internal names in fgds. If internal name doesn't need to be specified use intn=0. |
{{KV|Name|intn=targetname|string|The name that other entities refer to this entity by.}}</nowiki><br/><nowiki> {{KV|Name|string|The name that other entities refer to this entity by.}} |
|
since |
This Keyvalue is available since this game. Can use either {{<game> add}} or {{Since}} templates. |
{{KV|I like Alien Swarm|intn=likealienswarm|bool|I'm available in Portal 2, too!|since=AS}} |
|
also |
This Keyvalue is also available in this game. Can use either {{<game> also}} or {{Also}} templates. |
{{KV|I like Alien Swarm|intn=likealienswarm|bool|I'm also available in Garry's Mod!|since=AS|also=GMOD}} |
|
only |
This Keyvalue is available only in this game. Can use either {{<game> only}} or {{Only}} templates. |
{{KV|I love Alien Swarm|intn=lovealienswarm|integer|I'm only available in Alien Swarm!|only=AS}} |
|
not |
This Keyvalue is not available just in this game. Only uses the template {{Not}} . |
{{KV|I love Alien Swarm|intn=lovealienswarm|integer|I'm available in Portal 2 too, but not in CS:GO!|since={{as}}|removed={{csgo}}}} |
|
removed |
This Keyvalue was removed in this game onwards. Only uses the template {{Removed}} . |
{{KV|I love Alien Swarm|intn=lovealienswarm|integer|Actually... I'm not here anymore since Portal 2, including CS:GO...|since={{as}}|removed={{csgo}}}} |
|
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...}} |
|
See also
- Template:I
- Template:O
- Template:Fl
- Template:MatParamDefThe above documentation is transcluded from Template:KeyValue/doc. (Edit | Page history)
Editors can experiment in this template's sandbox (edit) and testcases (create) pages.