Template:I: Difference between revisions

From Valve Developer Community
Jump to navigation Jump to search
(Added documentation)
No edit summary
 
(42 intermediate revisions by 11 users not shown)
Line 1: Line 1:
<noinclude>
{{doc}}
This template is used to generate input/output definitions on entity pages.


== Basic usage ==
<includeonly>
<nowiki>{{IO|<name>|<description>}}</nowiki>


{{note|Don't forget to use [[Template:=]] to escape any "{{=}}" characters in the text.}}
<onlyinclude>
; {{#if: {{{deprecated|}}} | <del> }}<!--
--><kbd>{{{1}}}</kbd> <!--
-->{{#if: {{{to|}}}        | <span style="font-weight: normal;">to</span> <kbd>{{{to}}}</kbd>}} <!--
-->{{#if: {{{param|}}}      | {{VT|{{{param}}}|type=input}} }}<!--
-->{{#if: {{{deprecated|}}} | </del> }}<!--
-->{{#if: {{{only|}}}      | &nbsp;{{only|{{IO/gameicon|{{{only}}}}}}}}}<!--
-->{{#if: {{{since|}}}    | &nbsp;{{since|{{IO/gameicon|{{{since}}}}}}}}}<!--
-->{{#if: {{{removed|}}}  | &nbsp;{{removed|{{IO/gameicon|{{{removed}}}}}}}}}<!--
-->{{#if: {{{not|}}}      | &nbsp;{{not|{{IO/gameicon|{{{not}}}}}}}}}<!--
-->{{#if: {{{also|}}}      | &nbsp;{{also|{{IO/gameicon|{{{also}}}}}}}}}<!--
-->{{#if: {{{nofgd|}}}      | &nbsp;{{Not in FGD}} }}<!--
-->{{#if: {{{deprecated|}}} | &nbsp;{{obs}} }}
: {{#if: {{{deprecated|}}} | {{Dictionary/Deprecated/{{pagelang}}}}{{period}}<br> }}<!--
-->{{#if:{{{special targets|}}}|<small style="color:gray">{{{special targets}}}</small><br>}}<!--
-->{{#if: {{{2|}}} | {{{2}}}}}<!--
--></onlyinclude>


== Named parameters ==
</includeonly>
{| class=standard-table
! Parameter || Description || Example || Preview
|-
| <code>deprecated</code> || Used to mark deprecated Keyvalues || <code><nowiki>{{IO|OnDeprecated|Really, don't use me anymore!|deprecated=1}}</nowiki></code> || {{IO|OnDeprecated|Really, don't use me anymore!|deprecated=1}}
|-
| <code>nofgd</code> || This input/output isn't available in the official FGD. || <code><nowiki>{{IO|AddFGD|Because I'm not there!|nofgd=1}}</nowiki></code> || {{IO|AddFGD|Because I'm not there!|nofgd=1}}
|-
| <code>param</code> || Optional variable type for parameters. || <code><nowiki>{{IO|SetString|Updates the string.|param=string}}</nowiki></code> || {{IO|SetString|Updates the string.|param=string}}
|-
| <code>since</code> || This input/output is available since this game. Uses the template <nowiki>{{<game> add}}</nowiki>. || <code><nowiki>{{IO|OnAlienSwarm|I'm available in Portal 2, too!|since=AS}}</nowiki></code> || {{IO|OnAlienSwarm|I'm available in Portal 2, too!|since=AS}}
|-
| <code>to</code> || Use this to define a set of inputs/outputs with very similar names. || <code><nowiki>{{IO|Sound01|to=Sound24|There're many of us...}}</nowiki></code> || {{IO|Sound01|to=Sound24|There're many of us...}}
|}
 
== See also ==
* [[Template:KV]]
 
<hr>
</noinclude>; {{#if: {{{deprecated|}}} | <del> }}<code>{{{1}}}</code> {{#if: {{{to|}}} | <span style="font-weight: normal;">to</span> <code>{{{to}}}</code>}} {{#if: {{{param|}}} | {{KV Type|{{{param}}}}} }}{{#if: {{{deprecated|}}} | </del> }}{{#if: {{{since|}}} | &nbsp;{{{{{since}}} add}} }}{{#if: {{{nofgd|}}} | {{Not in FGD}} }}
: {{#if: {{{deprecated|}}} | Deprecated.&nbsp; }}{{#if: {{{2|}}} | {{{2}}} | {{todo|add description}} }}<noinclude>
[[Category:FGD Templates]]
</noinclude>

Latest revision as of 12:13, 26 May 2025

English (en)Deutsch (de)Esperanto (eo)Español (es)Français (fr)Suomi (fi)Hrvatski (hr)Magyar (hu)Italiano (it)日本語 (ja)한국어 (ko)Nederlands (nl)Polski (pl)Português (pt)Português do Brasil (pt-br)Русский (ru)Slovenčina (sk)Svenska (sv)Türkçe (tr)Українська (uk)Tiếng Việt (vi)中文 (zh)中文(臺灣) (zh-tw)
Curly brackets white.pngTemplate Documentation [view] [edit]
Icon-translate.png Available doc translations
View
Page history

This template is used to generate input definitions on entity pages. Use {{O}} for output definitions.

Usage

{{I|<name>|<description>}}

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

Examples and Parameters

Parameter Description Example Preview
deprecated This input/output is deprecated and should no longer be used. {{O|OnDeprecated|Really, don't use me anymore!|deprecated=1}}
OnDeprecated  Obsolete
Deprecated.
Really, don't use me anymore!
nofgd This input/output isn't available in the official FGD. {{I|AddFGD|Because I'm not there!|nofgd=1}}
AddFGD  !FGD
Because I'm not there!
param Optional variable type for parameters. {{I|SetString|Updates the string.|param=string}}
SetString <string>
Updates the string.
since This input/output is available since this game. Can use either {{<game> add}} or {{Since}} templates. {{O|OnAlienSwarm|I'm available in Portal 2, too!|since=AS}}
OnAlienSwarm  (in all games since Alien Swarm)
I'm available in Portal 2, too!
also This input/output is also available in this game. Can use either {{<game> also}} or {{Also}} templates. {{O|OnAlienSwarm|I'm also available in Garry's Mod!|since=AS|also=GMOD}}
OnAlienSwarm  (in all games since Alien Swarm) (also in Garry's Mod)
I'm also available in Garry's Mod!
only This input/output is available only in this game. Can use either {{<game> only}} or {{Only}} templates. {{O|OnAlienSwarm|I'm only available in Alien Swarm!|only=AS}}
OnAlienSwarm  (only in Alien Swarm)
I'm only available in Alien Swarm!
not This input/output is not available just in this game. Only uses the template {{Not}}. {{O|OnAlienSwarm|I'm available in Portal 2 as well, but not in CS:GO!|since={{as}}|not={{csgo}}}}
OnAlienSwarm  (in all games since Alien Swarm) (not in Counter-Strike: Global Offensive)
I'm available in Portal 2 too, but not in CS:GO!
removed This input/output was removed in this game. Only uses the template {{Removed}}. {{O|OnAlienSwarm|I'm available in Portal 2 too, but not in CS:GO, nor in anything after it!|since={{as}}|removed={{csgo}}}}
OnAlienSwarm  (in all games since Alien Swarm) (removed since Counter-Strike: Global Offensive)
I'm available in Portal 2 too, but not in CS:GO!
to Use this to define a set of inputs/outputs with very similar names. {{I|SetTarget1|to=SetTarget4|param=string|Sets targets 1-4…}}
SetTarget1 to SetTarget4 <string>
Sets targets 1-4…

See also