Template:KeyValue/doc: Difference between revisions
Jump to navigation
Jump to search
Note:Don't forget to use Template:= to escape any "=" characters in the text.
mNo edit summary |
No edit summary |
||
Line 1: | Line 1: | ||
{{Documentation subpage}} | |||
<!-- Please place categories where indicated at the bottom of this page.) --> | |||
This template is used to generate [[Keyvalue]] definitions on entity pages. | This template is used to generate [[Keyvalue]] definitions on entity pages. | ||
== Usage == | == Usage == | ||
<nowiki>{{KV|<name>|<variable type>|<description>}}</nowiki> | |||
{{ | {{note|Don't forget to use [[Template:=]] to escape any "{{=}}" characters in the text.}} | ||
== Examples and Parameters == | == Examples and Parameters == | ||
Line 30: | Line 30: | ||
| <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...}} | | <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...}} | ||
|} | |} | ||
== Future formatting == | |||
=== Parameters === | |||
* {{Param|new}} - A temporary parameter that will be deleted along with the old code as soon as all pages are updated. | |||
* {{Param|start}} - The beginning of the table. | |||
* {{Param|end}} - End of the table. | |||
* {{Param|divider}} - Divides the contents of the table with an empty row. | |||
* {{Param|sectiontitle}} - The same as {{Param|divider}}, but with the ability to write text. | |||
* {{Param|deprecated}} - Adds {{obs|4}} to the description, and also replaces the background of the table row. | |||
* {{Param|1}} - Key | |||
* {{Param|2}} - Variable | |||
* {{Param|3}} - Property Name | |||
* {{Param|4}} - Description | |||
* {{Param|value}} - Default Value | |||
* {{Param|color}} - Default Value | |||
* {{Param|rawValue}} - Default Value | |||
* {{Param|src}} - Source | |||
* {{Param|toKey}} - "Key1 '''to''' Key2" | |||
* {{Param|toPN}} - "PropertyName1 '''to''' PropertyName2" | |||
=== Preview === | |||
{{Capsule|text={{KV|start}} | |||
{{KV|new=true|targetname|string|src=Targetname|[[Targetname|Name]]|The [[Targetname|targetname]] that other entities refer to this entity by.}} | |||
{{KV|sectiontitle = Effects}} | |||
{{KV|new=true|rendercolor|color255|Color|color=78 43 62|removed={{csgo}}|Example.}} | |||
{{KV|new=true|deprecated=true|sound1|toKey=sound24|string|Sound 1|toPN=Sound 24|value=common/null.wav|also=GMOD|since={{as}}|removed={{csgo}}|{{lorem ipsum}} | |||
Values: | |||
# Value | |||
# Value | |||
# Value | |||
# Value | |||
# Value | |||
# Value | |||
# Value | |||
# Value | |||
# Value | |||
# Value | |||
# Value | |||
# Value}} | |||
{{KV|end}}}} | |||
== See also == | == See also == | ||
Line 36: | Line 77: | ||
* [[Template:MatParam]] | * [[Template:MatParam]] | ||
{{ | <includeonly>{{sandbox other|| | ||
<!-- Categories below this line, please --> | |||
[[Category:FGD Templates]] | [[Category:FGD Templates]] | ||
}} | }}</includeonly> |
Revision as of 06:48, 2 May 2023

This is a documentation subpage for Template:KeyValue.
Don't forget to purge the contents of the base page upon creating or editing this subpage.
Don't forget to purge the contents of the base page upon creating or editing this subpage.
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. | {{KV|Name|intn=targetname|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...}} |
|
Future formatting
Parameters
- {{{new}}} - A temporary parameter that will be deleted along with the old code as soon as all pages are updated.
- {{{start}}} - The beginning of the table.
- {{{end}}} - End of the table.
- {{{divider}}} - Divides the contents of the table with an empty row.
- {{{sectiontitle}}} - The same as {{{divider}}}, but with the ability to write text.
- {{{deprecated}}} - Adds
Obsolete to the description, and also replaces the background of the table row.
- {{{1}}} - Key
- {{{2}}} - Variable
- {{{3}}} - Property Name
- {{{4}}} - Description
- {{{value}}} - Default Value
- {{{color}}} - Default Value
- {{{rawValue}}} - Default Value
- {{{src}}} - Source
- {{{toKey}}} - "Key1 to Key2"
- {{{toPN}}} - "PropertyName1 to PropertyName2"
Preview
; start ([todo internal name (i)])
- {{{1}}} ([todo internal name (i)])
sound1 ([todo internal name (i)]) <string>(in all games since) (removed since
) (also in
)
- Deprecated.
Sound 1
- end ([todo internal name (i)])
See also