Template:Ent/doc: Difference between revisions

From Valve Developer Community
Jump to navigation Jump to search
(notice for "entity mode")
 
(23 intermediate revisions by 8 users not shown)
Line 1: Line 1:
{{documentation subpage}}
{{Doc/subpage}}
{{ModernNote|'''The entity mode will move to a new page - [[Template:Entity]]. Don't use this template on entity mode for now. Later, you should use {{tl|entity}} for the first sentence on entity pages.'''}}
This template is a faster and cleaner way of marking text as both a link and code. It should be used only on entity names. See the following for its syntax.
This template has two purposes. See the following for details.
 
== Parameters and Examples ==
== Parameters and Examples ==
{| class=standard-table | style="width:100%;"
{| class=standard-table | style="width:100%"
|-
|-
! Parameter
! Parameter
Line 10: Line 10:
! Preview
! Preview
|-
|-
|align="center"|{{Code|{{param|mode}}}}
| align="center" | <code>{{Param}}</code>
| The mode of the template. The following modes are available:
| The entity name should link and show.
:* {{Code|entity}} - The same purpose to {{tl|base point}} series templates.
| <pre>{{ent|logic_relay}}</pre>
:* Default - The original purpose of the template.
| bgcolor="#262626" | {{ent|logic_relay}}
| {{CodeBlock|<nowiki>{{ent|sv_cheats|1}}</nowiki>}}
| {{Doc/PreviewBlock|{{ent|sv_cheats|1}}}}
|-
|-
|}
| align="center" | <code>{{Param|game}}</code>
=== Default Mode ===
| Game name. Appends <code>' ({{param|game}})'</code> to the link.
This mode 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.
| <pre>{{ent|player|game=Left 4 Dead series}}</pre>
 
| bgcolor="#262626" | {{ent|player|game=Left 4 Dead series}}
See the following for syntax.
 
{| class=standard-table | style="width:100%;"
|-
|-
! Parameter
| align="center" | <code>{{Param|engine}}</code>
! Description
| Engine name. Specifying
! Example
* 0 or goldsrc appends ' (GoldSrc)' to the link
! Preview
* 1 or source appends ' (Source)' to the link
|-
* 2 or source 2 appends ' (Source 2)' to the link
|align="center"|{{Code|{{param|1}}}}
| <pre>{{ent|func_pushable|engine=goldsrc}}</pre>
|The entity name should link and show.
| bgcolor="#262626" | {{ent|func_pushable|engine=goldsrc}}
|{{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}}}}
|-
|-
|}
|}


=== Entity Mode ===
== See also ==
{{Note|The template has still the old code of {{tl|point ent}} for compatibility with those page having not updated.}}
* {{T|matparam}}
This mode is used to describe the basic information of a entity. See the following for usage.
* {{T|cmd}}
{| class=standard-table | style="width:100%;"
|-
! Parameter
! Description
! Example
! Preview
|-
|align="center"|{{Code|{{param|type}}}}
| The type of the entity. The following types are available:
:* {{Code|e0}} - [[Point entity]]
:* {{Code|e1}} - [[Internal entity|Internal]] point entity
:* {{Code|e2}} - [[Brush entity]]
:* {{Code|e3}} - Internal brush entity
:* {{Code|e4}} - [[Mesh entity]] ({{source2}})
:* {{Code|e5}} - [[Path entity]] ({{source2}})
:* Default - Point entity
:* You can specify the entity type yourself. (See examples)
|
# {{CodeBlock|<nowiki>{{ent|mode=entity|type=''incredible entity''|engine=''Mosaic''}}</nowiki>}}
# {{CodeBlock|<nowiki>{{ent|mode=entity|type=e1|engine=3}}</nowiki>}}<br>
# {{CodeBlock|<nowiki>{{ent|mode=entity|type=e2|engine=1}}</nowiki>}}
|
# {{Doc/PreviewBlock|{{ent|mode=entity|type=''incredible entity''|engine=''Mosaic''}}}}
# {{Doc/PreviewBlock|{{ent|mode=entity|type=e1|engine=3}}}}
# {{Doc/PreviewBlock|{{ent|mode=entity|type=e2|engine=1}}}}
|-
|align="center"|{{Code|{{param|engine}}}}
| Which engine the entity belongs to.
:* {{Code|1}} - {{gldsrc|4}}
:* {{Code|2}} - {{source|4}}
:* {{Code|3}} - {{source2|4}}
:* Default - {{source|4}}
|
# {{CodeBlock|<nowiki>{{ent|mode=entity|type=e1|engine=3}}</nowiki>}}
# {{CodeBlock|<nowiki>{{ent|mode=entity|type=e1}}</nowiki>}}
|
# {{Documentation/PreviewBlock|{{ent|mode=entity|type=e1|engine=3}}}}
# {{Documentation/PreviewBlock|{{ent|mode=entity|type=e1}}}}
|-
|align="center"|{{Code|{{param|since}}}}
| This entity is available since this game. {{Note|Should be the full name of the game, not a abbreviation (So templates can link to multilingual pages according to the language suffix).}}
| {{CodeBlock|<nowiki>{{ent|mode=entity|type=e0|info_player_start|engine=1|since=Half-Life}}</nowiki>}}
| {{Documentation/PreviewBlock|{{ent|mode=entity|type=e0|notitlechange=1|info_player_start|engine=1|since=Half-Life}}}}
|-
|align="center"|{{Code|{{param|1}}}}
| The name of the entity. It will change the title of a page. {{Note|The template can't change the title when the {{tl|lang|}} is in use. }}{{workaround|Specify the {{param|title|tag=kbd}} of {{tl|lang}} to {{Code|<nowiki>{{Code|selected=1|<entity name>}}</nowiki>}}.}}
| {{CodeBlock|<nowiki>{{ent|mode=entity|type=e0|info_player_start}}</nowiki>}}
| {{Documentation/PreviewBlock|{{ent|mode=entity|type=e0|notitlechange=1|info_player_start}}}}
|-
|align="center"|{{Code|{{param|series}}}}
| The series that the entity is available in.
| {{CodeBlock|<nowiki>{{ent|mode=entity|type=e2|series=Counter-Strike}}</nowiki>}}
| {{Documentation/PreviewBlock|{{ent|mode=entity|type=e2|series=Counter-Strike}}}}
|-
|align="center"|{{Code|{{param|seriescs}}}}
| The series of Counter-Strike that the entity is available in.
| {{CodeBlock|<nowiki>{{ent|mode=entity|type=e3|seriescs=Counter-Strike|game=Counter-Strike: Source}}</nowiki>}}
| {{Documentation/PreviewBlock|{{ent|mode=entity|type=e3|seriescs=Counter-Strike|game=Counter-Strike: Source}}}}
|-
|align="center"|{{Code|{{param|game}}}}
| The game that the entity is available in. {{Note|Should be the full name of the game, not a abbreviation (So templates can link to multilingual pages according to the language suffix).}}
| {{CodeBlock|<nowiki>{{ent|mode=entity|type=e5|game=Team Fortress 2}}</nowiki>}}
| {{Documentation/PreviewBlock|{{ent|mode=entity|type=e5|game=Team Fortress 2}}}}
|-
|align="center"|{{Code|{{param|notitlechange}}}}
| You can prevent title-changing from the template by using this parameter. Used in the {{Code|/doc}} page.
| {{CodeBlock|<nowiki>{{ent|mode=entity|type=e0|notitlechange=1|info_player_start|engine=1|since=Half-Life}}</nowiki>}}
| {{Documentation/PreviewBlock|{{ent|mode=entity|type=e0|notitlechange=1|info_player_start|engine=1|since=Half-Life}}}}
|-
|align="center"|{{Code|{{param|suf}}}}
| Specify the language suffix. The template supports multi-language and you can add more languages that the template supports.
|
# {{CodeBlock|<nowiki>{{ent|mode=entity|suf=:zh-cn|type=e0|info_player_start|engine=1|since=Half-Life}}</nowiki>}}
# {{CodeBlock|<nowiki>{{ent|mode=entity|suf=:ru|type=e0|info_player_start|engine=1|since=Half-Life}}</nowiki>}}
|
# {{Documentation/PreviewBlock|{{ent|mode=entity|suf=:zh-cn|type=e0|notitlechange=1|info_player_start|engine=1|since=Half-Life}}}}
# {{Documentation/PreviewBlock|{{ent|mode=entity|suf=:ru|type=e0|notitlechange=1|info_player_start|engine=1|since=Half-Life}}}}
|}


== See Also ==
<includeonly>{{sandbox other||
* {{tl|Point ent}}
[[Category:Templates]][[Category:Formatting templates]][[Category:Entity Templates]]
* {{tl|Base point multi}}
}}</includeonly>
* {{tl|Brush ent}}
* {{tl|Base brush multi}}
* {{tl|Game name}}
[[Category:Entity Templates]]

Latest revision as of 10:17, 24 August 2025

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 is a faster and cleaner way of marking text as both a link and code. It should be used only on entity names. See the following for its syntax.

Parameters and Examples

Parameter Description Example Preview
{{{1}}} The entity name should link and show.
{{ent|logic_relay}}
logic_relay
{{{game}}} Game name. Appends ' ({{{game}}})' to the link.
{{ent|player|game=Left 4 Dead series}}
player
{{{engine}}} Engine name. Specifying
  • 0 or goldsrc appends ' (GoldSrc)' to the link
  • 1 or source appends ' (Source)' to the link
  • 2 or source 2 appends ' (Source 2)' to the link
{{ent|func_pushable|engine=goldsrc}}
func_pushable

See also