Template:Ent/doc: Difference between revisions

From Valve Developer Community
Jump to navigation Jump to search
(updated specifically)
Line 1: Line 1:
{{documentation subpage}}
{{documentation subpage}}
This template has two purposes. See the following for details.
This template has two purposes. See the following for details.
== Default Mode ==
== Parameters, Descriptions and Examples ==
{| class=standard-table | style="width:100%;"
|-
! Parameter
! Description
! Example
! Preview
|-
|align="center"|{{Code|{{param|mode}}}}
| The mode of the template. The following modes are available:
:* {{Code|entity}} - The same purpose to {{tl|base point}} series templates.
:* Default - The original purpose of the template.
| {{CodeBlock|<nowiki>{{ent|sv_cheats|1}}</nowiki>}}
| {{Doc/PreviewBlock|{{ent|sv_cheats|1}}}}
|-
|}
=== Default Mode ===
This template is a faster and cleaner way of marking text as both a link and code. Its primary use is on entity names, but it is used on other things too, such as VMT parameters and console commands.
This template is a faster and cleaner way of marking text as both a link and code. Its primary use is on entity names, but it is used on other things too, such as VMT parameters and console commands.


The syntax is simple. <code><nowiki>{{ent|logic_relay}}</nowiki></code> would return as {{ent|logic_relay}}.
See the following for syntax.


Optionally, you can specify a second field of text to not be counted as a link.
{| class=standard-table | style="width:100%;"
|-
! Parameter
! Description
! Example
! Preview
|-
|align="center"|{{Code|{{param|1}}}}
|The entity name should link and show.
|{{CodeBlock|<nowiki>{{ent|logic_relay}}</nowiki>}}
|{{Doc/PreviewBlock|{{ent|logic_relay}}}}
|-
|align="center"|{{Code|{{param|2}}}}
|Optionally, you can specify a second field of text to not be counted as a link.
| {{CodeBlock|<nowiki>{{ent|sv_cheats|1}}</nowiki>}}
| {{Doc/PreviewBlock|{{ent|sv_cheats|1}}}}
|-
|align="center"|{{Code|{{param|alt}}}}
|The entity name should show. (Additionally, you can specify {{param|alt}} as a different name to show. )
|{{CodeBlock|<nowiki>{{ent|Team Fortress 2.fgd|alt=tf.fgd}}</nowiki>}}
|{{Doc/PreviewBlock|{{ent|Team Fortress 2.fgd|alt=tf.fgd}}}}
|-
|}


<code><nowiki>{{ent|sv_cheats|1}}</nowiki></code> would give you {{ent|sv_cheats|1}}.
=== Entity Mode ===
 
Additionally, you can specify {{param|alt}} as a different name to show. For example, <code><nowiki>{{ent|Team Fortress 2.fgd|alt=tf.fgd}}</nowiki></code> would return {{ent|Team Fortress 2.fgd|alt=tf.fgd}}.
 
== Entity Mode ==
{{Note|The template has still the old code of {{tl|point ent}} for compatibility with those page having not updated.}}
{{Note|The template has still the old code of {{tl|point ent}} for compatibility with those page having not updated.}}
=== Parameters and Examples ===
This mode is used to describe the basic information of a entity. See the following for usage.
{| class=standard-table | style="width:100%;"
{| class=standard-table | style="width:100%;"
|-
|-
Line 40: Line 74:
# {{Doc/PreviewBlock|{{ent|mode=entity|type=e1|engine=3}}}}
# {{Doc/PreviewBlock|{{ent|mode=entity|type=e1|engine=3}}}}
# {{Doc/PreviewBlock|{{ent|mode=entity|type=e2|engine=1}}}}
# {{Doc/PreviewBlock|{{ent|mode=entity|type=e2|engine=1}}}}
|-
|align="center"|{{Code|{{param|mode}}}}
| The mode of the template. The following modes are available:
:* {{Code|entity}} - The same purpose to {{tl|base point}} series templates.
:* Default - The original purpose of the template.
| {{CodeBlock|<nowiki>{{ent|sv_cheats|1}}</nowiki>}}
| {{Doc/PreviewBlock|{{ent|sv_cheats|1}}}}
|-
|-
|align="center"|{{Code|{{param|engine}}}}
|align="center"|{{Code|{{param|engine}}}}
Line 101: Line 128:
|}
|}


=== See Also ===
== See Also ==
* {{tl|Point ent}}
* {{tl|Point ent}}
* {{tl|Base point multi}}
* {{tl|Base point multi}}

Revision as of 01:12, 23 January 2023

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

This template has two purposes. See the following for details.

Parameters, Descriptions and Examples

Parameter Description Example Preview
{{{mode}}} The mode of the template. The following modes are available:
  • entity - The same purpose to {{base point}} series templates.
  • Default - The original purpose of the template.
{{ent|sv_cheats|1}}

Default Mode

This template is a faster and cleaner way of marking text as both a link and code. Its primary use is on entity names, but it is used on other things too, such as VMT parameters and console commands.

See the following for syntax.

Parameter Description Example Preview
{{{1}}} The entity name should link and show.
{{ent|logic_relay}}
{{{2}}} Optionally, you can specify a second field of text to not be counted as a link.
{{ent|sv_cheats|1}}
{{{alt}}} The entity name should show. (Additionally, you can specify {{{alt}}} as a different name to show. )
{{ent|Team Fortress 2.fgd|alt=tf.fgd}}

Entity Mode

Note.pngNote:The template has still the old code of {{point ent}} for compatibility with those page having not updated.

This mode is used to describe the basic information of a entity. See the following for usage.

Parameter Description Example Preview
{{{type}}} The type of the entity. The following types are available:
  1. {{ent|mode=entity|type=''incredible entity''|engine=''Mosaic''}}
  2. {{ent|mode=entity|type=e1|engine=3}}

  3. {{ent|mode=entity|type=e2|engine=1}}
  1. [[{{{1}}} (Mosaic)|{{{1}}}]]
  2. [[{{{1}}} (3)|{{{1}}}]]
  3. [[{{{1}}} (Source)|{{{1}}}]]
{{{engine}}} Which engine the entity belongs to.
  1. {{ent|mode=entity|type=e1|engine=3}}
  2. {{ent|mode=entity|type=e1}}
  1. [[{{{1}}} (3)|{{{1}}}]]
  2. [[{{{1}}}|{{{1}}}]]
{{{since}}} This entity is available since this game.
Note.pngNote:Should be the full name of the game, not a abbreviation (So templates can link to multilingual pages according to the language suffix).
{{ent|mode=entity|type=e0|info_player_start|engine=1|since=Half-Life}}
{{{1}}} The name of the entity. It will change the title of a page.
Note.pngNote:The template can't change the title when the {{lang}} is in use.
PlacementTip.pngWorkaround:Specify the {{{title}}} of {{lang}} to {{Code|selected=1|<entity name>}}.
{{ent|mode=entity|type=e0|info_player_start}}
{{{series}}} The series that the entity is available in.
{{ent|mode=entity|type=e2|series=Counter-Strike}}
[[{{{1}}}|{{{1}}}]]
{{{seriescs}}} The series of Counter-Strike that the entity is available in.
{{ent|mode=entity|type=e3|seriescs=Counter-Strike|game=Counter-Strike: Source}}
[[{{{1}}} (Counter-Strike: Source)|{{{1}}}]]
{{{game}}} The game that the entity is available in.
Note.pngNote:Should be the full name of the game, not a abbreviation (So templates can link to multilingual pages according to the language suffix).
{{ent|mode=entity|type=e5|game=Team Fortress 2}}
[[{{{1}}} (Team Fortress 2)|{{{1}}}]]
{{{notitlechange}}} You can prevent title-changing from the template by using this parameter. Used in the /doc page.
{{ent|mode=entity|type=e0|notitlechange=1|info_player_start|engine=1|since=Half-Life}}
{{{suf}}} Specify the language suffix. The template supports multi-language and you can add more languages that the template supports.
  1. {{ent|mode=entity|suf=:zh-cn|type=e0|info_player_start|engine=1|since=Half-Life}}
  2. {{ent|mode=entity|suf=:ru|type=e0|info_player_start|engine=1|since=Half-Life}}

See Also

  • {{Point ent}}
  • {{Base point multi}}
  • {{Brush ent}}
  • {{Base brush multi}}
  • {{Game name}}