Difference between revisions of "Entity Article Template"

From Valve Developer Community
Jump to: navigation, search
(Does displaytitle even work?)
(Entity description: typo)
 
(4 intermediate revisions by the same user not shown)
Line 1: Line 1:
<nowiki>{{{<game acronym> <point/brush>|<entity class name>}}}</nowiki>
+
<nowiki>{{<game acronym> <point/brush>|<entity class name>}}</nowiki>
 
{{syntax2
 
{{syntax2
 
|in=<nowiki>{{css point|ammo_57mm}}</nowiki>
 
|in=<nowiki>{{css point|ammo_57mm}}</nowiki>
|out={{css}} '''ammo_57mm''' is a [[point entity]] available in [[Counter-Strike: Source]].
+
|out={{css}}'''ammo_57mm''' is a [[point entity]] available in Counter-Strike: Source.
 
}}
 
}}
{{tip|If the entity is available everywhere, use "base" as game acronym.}}
+
{{tip|If the entity is available in all source games, use <code>base</code> as game acronym.}}
  
== Entity description ==
+
==Entity description==
This should be a plainly-worded but accurate description of the basic function of the entity. A basic description for most entities is included in the help built into [[Hammer]].
+
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.
  
For an NPC's inputs, outputs etc. the [[Npc_sniper|npc_sniper]] article could be handy. Many of the details seem the same for different NPCs, so it could save typing.
+
[[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.
  
The information for the entity Keys, Outputs, and Inputs can be found inside the Hammer entity help, or in the [[FGD]]. Flag names can only be found in the [[FGD]].
+
Also include [[:Template:Code class]]:
 +
{{syntax2
 +
|in=<nowiki>{{code class|CEntityClass|entityfile}}</nowiki>
 +
|out={{code class|CEntityClass|entityfile}}
 +
}}
 +
The entity's code class name can be found by searching <code>LINK_ENTITY_TO_CLASS</code> in the CPP file defining it.
  
== Dedicated Console Variables - omit if none exist ==
+
==Dedicated Console Variables and Commands (omit if none exist)==
; cvar_name <data type>
+
Console variables and commands can be found by searching <code>ConVar</code> and <code>ConCommand</code> in the CPP file that defines the entity. Note a parameter if any exist.
: Omittable Description
+
;cvar_name <data type>
; sk_barney_health <integer>
+
:Description.
: Barney's spawn health
+
;sk_barney_health <integer>
 +
:Barney's spawn health.
  
== Keyvalues - omit if none exist ==
+
==Flags (omit if none exist)==
{{tip|See [[:Category:Keyvalue Templates]] for a list of available templates.}}
+
{{tip|See [[:Category:Flag Templates]] for a list of available templates.}}
{{KV|Keyvalue Name|vartype|A description of the Keyvalue.}}
 
{{KV|Brightness|color255|The color of the spotlight cone.}}
 
  
=== {{Game link|Half-Life 2}} ===
+
*Integer value: Flag Name
{{tip| Use <nowiki>=== {{Game link|Game Name}} ===</nowiki> to sort Keyvalues that exist only in selected games.}}
+
:Description if necessary.
{{KV Targetname}}
+
*16: Start Silent
{{KV Parentname}}
+
:The map will start without this sound playing. Enabled by default.
{{KV Angles}}
 
{{KV DXLevelChoice}}
 
  
== Flags - omit if none exist ==
+
==Keyvalues==
{{tip|See [[:Category:Flag Templates]] for a list of available templates.}}
+
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.
  
* Integer value : Flag Name
+
Individual keyvalues are defined with [[:Template:KV]].
: Omissible description
+
{{tip|See [[:Category:Keyvalue Templates]] for a list of available templates.}}
* Integer value : Flag Name
+
{{KV|Keyvalue Name (non-SmartEdit name)|vartype|A description of the keyvalue.}}
: Omissible description
+
{{KV|Render Amount (renderamt)|integer|Transparency amount, requires a Render Mode other than Normal. 0 is invisible, 255 is fully visible.}}
  
== Inputs - omit if none exist ==
+
==Inputs==
 +
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|Input Name|A description of the Input.|param=vartype}}
+
{{IO|InputName|A description of the input.|param=optional vartype}}
 
{{IO|SetSpeed|Set the speed of the train, as a ratio of max speed [0, 1]|param=float}}
 
{{IO|SetSpeed|Set the speed of the train, as a ratio of max speed [0, 1]|param=float}}
{{I Targetname}}
 
{{I Parentname}}
 
  
== Outputs - omit if none exist ==
+
==Outputs==
 
{{tip|See [[:Category:Output Templates]] for a list of available templates.}}
 
{{tip|See [[:Category:Output Templates]] for a list of available templates.}}
  
{{IO|Output Name|A description of the Input.}}
+
{{IO|OutputName|A description of the output.}}
 
{{IO|OnPressed|Fired when the button is pressed.}}
 
{{IO|OnPressed|Fired when the button is pressed.}}
{{O Targetname}}
 
  
== 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]] - appropriate links to tutorials, related articles and entities etc.
+
*[[Assaults]]
* [[ambient_generic]]
+
*{{ent|ambient_generic}}
  
 
[[Category:Entities]]
 
[[Category:Entities]]

Latest revision as of 08:18, 1 September 2018

{{<game acronym> <point/brush>|<entity class name>}}

 
 Example {{css point|ammo_57mm}} 
   Results <Counter-Strike: Source>ammo_57mm is a point entity available in Counter-Strike: Source.
Tip:If the entity is available in all source games, use base as game acronym.

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 In code, it is represented by class CEntityClass, defined in entityfile.

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:See Category:Flag Templates for a list of available templates.
  • Integer value: Flag Name
Description if necessary.
  • 16: Start Silent
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:See Category:Keyvalue Templates for a list of available templates.
Keyvalue Name (non-SmartEdit name) <vartype>
A description of the keyvalue.
Render Amount (renderamt) <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:See Category:Input Templates for a list of available templates.
InputName <optional vartype>
A description of the input.
SetSpeed <float>
Set the speed of the train, as a ratio of max speed [0, 1]

Outputs

Tip: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:Add links to related articles, entities, or tutorials here.