Entity Article Template: Difference between revisions

From Valve Developer Community
Jump to navigation Jump to search
No edit summary
mNo edit summary
Line 1: Line 1:
{{lang|Entity Article Template}}
{{Lang|Entity Article Template}}
{{back|Help:Page Creation}}
{{Back|Help:Page Creation}}
These are (optional) templates for the first text of an entity page. The last is the most important. Find other useful templates at [[Help:Templates#Notice Templates]].
These are (optional) templates for the first text of an entity page. The last is the most important. Find other useful templates at [[Help:Templates#Notice Templates]].
{| class=wikitable
{| class=wikitable
| {{tl2|lang|<page name>}} || Adds the flags on the top right for language pages and adds this page to an appropriate language [[Help:Categories|Category]]. For example, this page uses {{tlc|lang|Entity Article Template}}.
| {{tl2|Lang|<page name>}} || Adds the flags on the top right for language pages and adds this page to an appropriate language [[Help:Categories|Category]]. For example, this page uses {{tlc|lang|Entity Article Template}}.
|-
|-
| {{tl2|distinguish|Other Page Name}} || Adds a note with a link to a page that this page should not be confused with.
| {{tl2|Distinguish|Other Page Name}} || Adds a note with a link to a page that this page should not be confused with.
|-
|-
| {{tl2|stub}} || Adds a notice and a category for incomplete pages.
| {{tl2|Stub}} || Adds a notice and a category for incomplete pages.
|-
|-
| {{tl2|ent not in fgd}} || Adds a notice for entities that are not available in Hammer. Its text contains a link to a section "FGD Code" on the same page where code can be provided to make it available in Hammer. If it shouldn't add the parameter <code>nolink=1</code>. If the entity is available in Hammer but not in the game, use {{tl2|ent not in game}}.
| {{tl2|ent not in fgd}} || Adds a notice for entities that are not available in Hammer. Its text contains a link to a section "FGD Code" on the same page where code can be provided to make it available in Hammer. If it shouldn't add the parameter <code>nolink=1</code>. If the entity is available in Hammer but not in the game, use {{tl2|ent not in game}}.
Line 14: Line 14:
| Creates a first sentence with a link to the game.
| Creates a first sentence with a link to the game.
{{syntax2 |in=<nowiki>{{entity|type=e0|ammo_57mm|game=Counter-Strike: Source}}</nowiki>|out={{Code|select=1|ammo_57mm}} is a [[point entity]] available in {{css|4}}.}}
{{syntax2 |in=<nowiki>{{entity|type=e0|ammo_57mm|game=Counter-Strike: Source}}</nowiki>|out={{Code|select=1|ammo_57mm}} is a [[point entity]] available in {{css|4}}.}}
{{tip|If the entity is ''available in all Source games'', don't use {{Code|style=1|{{param|game}}}}. If available in multiple games, use {{Code|style=1|{{param|game1}}}} (See [[Template:Entity|the documentation of the template]] for details).}}{{Note|See [[Template:Entity|the documentation of the template]] for the details of entity types.}}
{{tip|If the entity is ''available in all Source games'', don't use {{Code|style=1|{{Param|game}}}}. If available in multiple games, use {{Code|style=1|{{Param|game1}}}} (See [[Template:Entity|the documentation of the template]] for details).}}{{Note|See [[Template:Entity|the documentation of the template]] for the details of entity types.}}
|}
|}


==Entity Description==
==Entity Description==
This should be a plainly-worded but accurate description of the basic function of the entity. A very basic description for most entities is included in the help built into [[Hammer]]. If the description isn't overly long, omit the header and put it at the top with the first sentence on the page.
This should be a plainly-worded but accurate description of the basic function of the entity. A very basic description for most entities is included in the help built into {{Hammer|1}}. If the description isn't overly long, omit the header and put it at the top with the first sentence on the page.


[[FGD]]s (and by extension the Hammer properties window) are good sources for information on an entity's keyvalues, inputs, outputs, and flags, however FGDs often will not list ''everything'' available for an entity. Because of this, the wiki uses a mix of [[Help:Templates|templates]] that roughly follow the engine's class hierarchy and ones that follow FGDs.
[[.fgd|FGDs]] (and by extension the Hammer properties window) are good sources for information on an entity's keyvalues, inputs, outputs, and flags, however FGDs often will not list ''everything'' available for an entity. Because of this, the wiki uses a mix of [[Help:Templates|templates]] that roughly follow the engine's class hierarchy and ones that follow FGDs.


Also include [[:Template:Code class]]:
Also include [[:Template:Code class]]:
Line 37: Line 37:


==Flags (omit if none exist)==
==Flags (omit if none exist)==
{{tip|See [[:Category:Flag Templates]] for a list of available templates.}}
{{Tip|See [[:Category:Flag Templates]] for a list of available templates.}}
For each flag, write one of the following.
For each flag, write one of the following.


Line 49: Line 49:


==Keyvalues==
==Keyvalues==
Since every entity inherits {{ent|CBaseEntity}}, all entity pages should have [[:Template:KV BaseEntity]] if not more. The only exceptions are [[internal entities]], which are removed during the compiling of a map and cannot receive I/O and most base keyvalues. This all applies to inputs and outputs as well.
Since every entity inherits {{ent|CBaseEntity}}, all entity pages should have [[:Template:KV BaseEntity]] if not more. The only exceptions are [[:Category:Internal entities|internal entities]], which are removed during the compiling of a map and cannot receive I/O and most base keyvalues. This all applies to inputs and outputs as well.


Individual keyvalues are defined with [[:Template:KV]].
Individual keyvalues are defined with [[:Template:KV]].
{{tip|See [[:Category:Keyvalue Templates]] for a list of available templates.}}
{{Tip|See [[:Category:Keyvalue Templates]] for a list of available templates.}}
{{KV|Keyvalue Name (non-SmartEdit name)|vartype|A description of the keyvalue.}}
{{KV|Keyvalue Name (non-SmartEdit name)|vartype|A description of the keyvalue.}}
{{KV|Render Amount (renderamt)|integer|Transparency amount, requires a Render Mode other than Normal. 0 is invisible, 255 is fully visible.}}
{{KV|Render Amount (renderamt)|integer|Transparency amount, requires a Render Mode other than Normal. 0 is invisible, 255 is fully visible.}}
Line 58: Line 58:
==Inputs==
==Inputs==
Individual inputs (and outputs) are defined with [[:Template:IO]]
Individual inputs (and outputs) are defined with [[:Template:IO]]
{{tip|See [[:Category:Input Templates]] for a list of available templates.}}
{{Tip|See [[:Category:Input Templates]] for a list of available templates.}}


{{IO|InputName|A description of the input.|param=optional vartype}}
{{IO|InputName|A description of the input.|param=optional vartype}}
Line 64: Line 64:


==Outputs==
==Outputs==
{{tip|See [[:Category:Output Templates]] for a list of available templates.}}
{{Tip|See [[:Category:Output Templates]] for a list of available templates.}}


{{IO|OutputName|A description of the output.}}
{{IO|OutputName|A description of the output.}}
Line 70: Line 70:


==See also==
==See also==
{{note|Add links to related articles, entities, or tutorials here.}}
{{Note|Add links to related articles, entities, or tutorials here.}}


*[[Assaults]]
*[[Assault]]s
*{{ent|ambient_generic}}
*{{ent|ambient_generic}}


[[Category:Entities]]
[[Category:Entities]]

Revision as of 11:24, 29 April 2023

English (en)Translate (Translate)
Help:Page Creation

These are (optional) templates for the first text of an entity page. The last is the most important. Find other useful templates at Help:Templates#Notice Templates.

{{Lang|<page name>}} Adds the flags on the top right for language pages and adds this page to an appropriate language Category. For example, this page uses {{lang|Entity Article Template}}.
{{Distinguish|Other Page Name}} Adds a note with a link to a page that this page should not be confused with.
{{Stub}} Adds a notice and a category for incomplete pages.
{{ent not in fgd}} Adds a notice for entities that are not available in Hammer. Its text contains a link to a section "FGD Code" on the same page where code can be provided to make it available in Hammer. If it shouldn't add the parameter nolink=1. If the entity is available in Hammer but not in the game, use {{ent not in game}}.
{{entity|<entity class name>|type=<entity type>|game=<full game name>}} Creates a first sentence with a link to the game.
 
 Example {{entity|type=e0|ammo_57mm|game=Counter-Strike: Source}} 
   Results ammo_57mm is a point entity available in Counter-Strike: Source Counter-Strike: Source.
Tip.pngTip:If the entity is available in all Source games, don't use {{{game}}}. If available in multiple games, use {{{game1}}} (See the documentation of the template for details).
Note.pngNote:See the documentation of the template for the details of entity types.

Entity Description

This should be a plainly-worded but accurate description of the basic function of the entity. A very basic description for most entities is included in the help built into Hammer. If the description isn't overly long, omit the header and put it at the top with the first sentence on the page.

FGDs (and by extension the Hammer properties window) are good sources for information on an entity's keyvalues, inputs, outputs, and flags, however FGDs often will not list everything available for an entity. Because of this, the wiki uses a mix of templates that roughly follow the engine's class hierarchy and ones that follow FGDs.

Also include Template:Code class:

 
 Example {{code class|CEntityClass|entityfile}} 
   Results
C++ In code, it is represented by theCEntityClassclass, defined in theentityfilefile.

The entity's code class name can be found by searching LINK_ENTITY_TO_CLASS in the CPP file defining it.

Dedicated Console Variables and Commands (omit if none exist)

Console variables and commands can be found by searching ConVar and ConCommand in the CPP file that defines the entity. Note a parameter if any exist.

cvar_name
Description.
sk_barney_health <integer>
Barney's spawn health.

Flags (omit if none exist)

Tip.pngTip:See Category:Flag Templates for a list of available templates.

For each flag, write one of the following.

{{fl|<integer>|<flag name>}}

{{fl|<integer>|<flag name>|<description>}}

Which could look like this:

Flag Name : [Integer value]
Description if necessary.
Start Silent : [16]
The map will start without this sound playing. Enabled by default.

Keyvalues

Since every entity inherits CBaseEntity, all entity pages should have Template:KV BaseEntity if not more. The only exceptions are internal entities, which are removed during the compiling of a map and cannot receive I/O and most base keyvalues. This all applies to inputs and outputs as well.

Individual keyvalues are defined with Template:KV.

Tip.pngTip:See Category:Keyvalue Templates for a list of available templates.
Keyvalue Name (non-SmartEdit name) ([todo internal name (i)]) <vartype>
A description of the keyvalue.
Render Amount (renderamt) ([todo internal name (i)]) <integer>
Transparency amount, requires a Render Mode other than Normal. 0 is invisible, 255 is fully visible.

Inputs

Individual inputs (and outputs) are defined with Template:IO

Tip.pngTip:See Category:Input Templates for a list of available templates.


InputName <optional vartype>
A description of the input.
SetSpeed <floatRedirectInput/float>
Set the speed of the train, as a ratio of max speed [0, 1]

Outputs

Tip.pngTip:See Category:Output Templates for a list of available templates.


OutputName
A description of the output.
OnPressed
Fired when the button is pressed.

See also

Note.pngNote:Add links to related articles, entities, or tutorials here.