Template:Ent/doc: Difference between revisions

From Valve Developer Community
Jump to navigation Jump to search
(Created page with "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 paramete...")
 
Line 1: Line 1:
{{documentation subpage}}
{{Note|This template will be improved. Should be renamed to '''[[:Template:Ent]]''' when completed. All templates associated with '''[[:Template:Base point]]''' will be deleted.}}
== 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.


Line 8: Line 11:


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}}.
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 ==
=== Parameters and Examples ===
{| 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>{{point ent|type=''incredible entity''|engine=''Mosaic''}}</nowiki>}}
# {{CodeBlock|<nowiki>{{point ent|type=e1|engine=3}}</nowiki>}}<br>
# {{CodeBlock|<nowiki>{{point ent|type=e2|engine=1}}</nowiki>}}
|
# {{Doc/PreviewBlock|{{point ent|type=''incredible entity''|engine=''Mosaic''}}}}{{Todo|Temporarily not working properly. Before fixing this, you need to add the {{param|type}} parameter to all pages that use this template.}}
# {{Doc/PreviewBlock|{{point ent|type=e1|engine=3}}}}
# {{Doc/PreviewBlock|{{point ent|type=e2|engine=1}}}}
|-
|align="center"|{{Code|{{param|mode}}}}
| The mode of the template. The following modes are available:
:* {{Code|name}} - The same to {{tl|ent}}.
:* Default - The original purpose of the template.
| {{CodeBlock|<nowiki>{{point ent|mode=name|sv_cheats|1}}</nowiki>}}
| {{Doc/PreviewBlock|{{point ent|mode=name|sv_cheats|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>{{point ent|type=e1|engine=3}}</nowiki>}}
# {{CodeBlock|<nowiki>{{point ent|type=e1}}</nowiki>}}
|
# {{Documentation/PreviewBlock|{{point ent|type=e1|engine=3}}}}
# {{Documentation/PreviewBlock|{{point ent|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>{{point ent|type=e0|info_player_start|engine=1|since=Half-Life}}</nowiki>}}
| {{Documentation/PreviewBlock|{{point ent|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>{{point ent|type=e0|info_player_start}}</nowiki>}}
| {{Documentation/PreviewBlock|{{point ent|type=e0|notitlechange=1|info_player_start}}}}
|-
|align="center"|{{Code|{{param|series}}}}
| The series that the entity is available in.
| {{CodeBlock|<nowiki>{{point ent|type=e2|series=Counter-Strike}}</nowiki>}}
| {{Documentation/PreviewBlock|{{point ent|type=e2|series=Counter-Strike}}}}
|-
|align="center"|{{Code|{{param|seriescs}}}}
| The series of Counter-Strike that the entity is available in.
| {{CodeBlock|<nowiki>{{point ent|type=e3|seriescs=Counter-Strike|game=Counter-Strike: Source}}</nowiki>}}
| {{Documentation/PreviewBlock|{{point ent|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>{{point ent|type=e5|game=Team Fortress 2}}</nowiki>}}
| {{Documentation/PreviewBlock|{{point ent|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>{{point ent|type=e0|notitlechange=1|info_player_start|engine=1|since=Half-Life}}</nowiki>}}
| {{Documentation/PreviewBlock|{{point ent|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>{{point ent|suf=:zh-cn|type=e0|info_player_start|engine=1|since=Half-Life}}</nowiki>}}
# {{CodeBlock|<nowiki>{{point ent|suf=:ru|type=e0|info_player_start|engine=1|since=Half-Life}}</nowiki>}}
|
# {{Documentation/PreviewBlock|{{point ent|suf=:zh-cn|type=e0|notitlechange=1|info_player_start|engine=1|since=Half-Life}}}}
# {{Documentation/PreviewBlock|{{point ent|suf=:ru|type=e0|notitlechange=1|info_player_start|engine=1|since=Half-Life}}}}
|}
=== See Also ===
* {{tl|Point ent}}
* {{tl|Base point multi}}
* {{tl|Brush ent}}
* {{tl|Base brush multi}}
* {{tl|Game name}}
[[Category:Entity Templates]]

Revision as of 00:30, 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.
Note.pngNote:This template will be improved. Should be renamed to Template:Ent when completed. All templates associated with Template:Base point will be deleted.

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.

The syntax is simple. {{ent|logic_relay}} would return as logic_relay.

Optionally, you can specify a second field of text to not be counted as a link.

{{ent|sv_cheats|1}} would give you sv_cheats 1.

Additionally, you can specify {{{alt}}} as a different name to show. For example, {{ent|Team Fortress 2.fgd|alt=tf.fgd}} would return tf.fgd.

Entity Mode

Parameters and Examples

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

  3. {{point ent|type=e2|engine=1}}
  1. Todo: Temporarily not working properly. Before fixing this, you need to add the {{{type}}} parameter to all pages that use this template.
{{{mode}}} The mode of the template. The following modes are available:
  • name - The same to {{ent}}.
  • Default - The original purpose of the template.
{{point ent|mode=name|sv_cheats|1}}
{{{engine}}} Which engine the entity belongs to.
  1. {{point ent|type=e1|engine=3}}
  2. {{point ent|type=e1}}
{{{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).
{{point ent|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>}}.
{{point ent|type=e0|info_player_start}}
{{{series}}} The series that the entity is available in.
{{point ent|type=e2|series=Counter-Strike}}
{{{seriescs}}} The series of Counter-Strike that the entity is available in.
{{point ent|type=e3|seriescs=Counter-Strike|game=Counter-Strike: Source}}
{{{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).
{{point ent|type=e5|game=Team Fortress 2}}
{{{notitlechange}}} You can prevent title-changing from the template by using this parameter. Used in the /doc page.
{{point ent|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. {{point ent|suf=:zh-cn|type=e0|info_player_start|engine=1|since=Half-Life}}
  2. {{point ent|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}}