Difference between revisions of "Template:KV BaseEntity"

From Valve Developer Community
Jump to: navigation, search
(removed TeamNum, and brought back the template's quirk to show all keys if no params are defined)
(When making a rotated trigger on the fly)
 
(6 intermediate revisions by one other user not shown)
Line 5: Line 5:
 
<!-- IF: BRUSH -->
 
<!-- IF: BRUSH -->
 
{{#if:{{{brush|}}}|{{minititle|Brush}}
 
{{#if:{{{brush|}}}|{{minititle|Brush}}
{{KV|Minimum Bounding Box Size|intn=mins|vector|Starting at the brush's origin, draw a bounding box this large. Requires<code>maxs</code> if used so the other side of the box isn't empty.|nofgd=1}}
+
{{KV|Minimum Bounding Box Size|intn=mins|vector|Starting at the brush's origin, mark the maximum bounding box's corner as this far away. Requires<code>maxs</code>if used so the other side of the box isn't empty.|nofgd=1}}
{{KV|Maximum Bounding Box Size|intn=maxs|vector|Starting at the brush's origin, draw a bounding box this large. Requires<code>mins</code> if used so the other side of the box isn't empty.|nofgd=1}}
+
{{KV|Maximum Bounding Box Size|intn=maxs|vector|Starting at the brush's origin, mark the minimum bounding box's corner as this far away. Requires<code>mins</code>if used so the other side of the box isn't empty.|nofgd=1}}
{{note|To translate a brush's size in Hammer to these keys, first divide the size value in Hammer by 2. Then, apply the resulting number to one of the 2 keys, then have the numbers inverted for the other key (Multiplied / Divided by -1).}}
+
:{{note|To translate a brush's size in Hammer to these keys, first divide the size value in Hammer by 2. Then, apply the resulting number to one of the 2 keys, with the numbers inverted for the other key (Multiplied / Divided by -1).}}
{{note|If collisions is already set, it must be set back to Bounding Box (solid 2).}}
+
:{{note|If collisions is already set, it must be set back to Bounding Box (solid 2).}}
{{confirm|Do all coordinates treat the origin as a "midpoint", and does it matter?}}
 
 
{{KV|Collisions|intn=solid|choices|Method of collision for this entity.|nofgd=1}}
 
{{KV|Collisions|intn=solid|choices|Method of collision for this entity.|nofgd=1}}
 
:*0: None
 
:*0: None
Line 18: Line 17:
 
:*5: Custom/Test
 
:*5: Custom/Test
 
:*6: [[VPhysics]]
 
:*6: [[VPhysics]]
{{KV|Model Index|intn=modelindex|short|Changes the entity's model to a precached model on the map.|nofgd=1}}}}
+
{{KV|Model Index|intn=modelindex|short|Changes the entity's model to a precached model on the map. Requires [[Prop_data#Creating_new_base_types|precaching models with propdata.txt]], then using<code>cl_precacheinfo modelprecache</code>while in-game to get the proper index number. {{warning|Needs to be setup meticulously to have no crashes.}}|nofgd=1}}
 +
| }}
 
<!--
 
<!--
 
   ++ Base ++
 
   ++ Base ++
Line 36: Line 36:
 
{{KV|Next Think|intn=nextthink|float|Amount of time before the entity [[Thinking|thinks]] again.|nofgd=1}}
 
{{KV|Next Think|intn=nextthink|float|Amount of time before the entity [[Thinking|thinks]] again.|nofgd=1}}
 
-->
 
-->
{{KV|Hammer ID|intn=hammerid|int|The entity's [[Hammer]] ID. Mainly used by plugins and debugging commands, such as '''<code>ent_keyvalue</code>'''. Can be manually assigned with the "hammerid" or "id" keyvalue. Entities spawned at run-time are not assigned any Hammer ID.|nofgd=1}}
+
{{KV|Hammer ID|intn=hammerid|int|The entity's [[Hammer]] ID. Mainly used by plugins and debugging commands, such as '''<code>ent_keyvalue</code>'''. Entities spawned at run-time are not assigned any Hammer ID.|nofgd=1}}
 
<!--
 
<!--
 
   ++ Game Specifics ++
 
   ++ Game Specifics ++
 
-->
 
-->
<!-- IF NOT: BASE, L4D2 AND CSGO -->
+
<!-- IF: L4D2 -->{{#if:{{{l4d2|}}}|
{{#if:{{{base|}}}||{{#if:{{{l4d2|}}}|
 
{{KV|Disable for Xbox 360|intn=disableX360|bool|If this entity should automatically be given the 'Disable' input on the Xbox 360 version of Source.|nofgd=1|since=L4D2}}
 
 
{{KV|Entity Scripts|intn=vscripts|scriptlist|Space delimited list of [[VScript]] files (without file extension) that are executed after all entities have spawned. The scripts are all executed in the same script scope, later ones overwriting any identical variables and functions.|since=L4D2}}
 
{{KV|Entity Scripts|intn=vscripts|scriptlist|Space delimited list of [[VScript]] files (without file extension) that are executed after all entities have spawned. The scripts are all executed in the same script scope, later ones overwriting any identical variables and functions.|since=L4D2}}
 
{{KV|Script think function|intn=thinkfunction|string|Name of a function in this entity's script which will be called automatically every 100 milliseconds (ten times a second) for the duration of the script. It can be used to create timers or to simulate autonomous behavior. The return value (if present) will set the time until the next call. Try to avoid [[expensive]] operations in this function, as it may cause performance problems.|since=L4D2}}
 
{{KV|Script think function|intn=thinkfunction|string|Name of a function in this entity's script which will be called automatically every 100 milliseconds (ten times a second) for the duration of the script. It can be used to create timers or to simulate autonomous behavior. The return value (if present) will set the time until the next call. Try to avoid [[expensive]] operations in this function, as it may cause performance problems.|since=L4D2}}
 
{{KV|[[Lag Compensation]]|intn=LagCompensate|boolean|Set to '''Yes''' to lag compensate this entity. Should be used very sparingly!|nofgd=1|since=L4D2}}
 
{{KV|[[Lag Compensation]]|intn=LagCompensate|boolean|Set to '''Yes''' to lag compensate this entity. Should be used very sparingly!|nofgd=1|since=L4D2}}
| <!-- ELSE IF: CSGO -->{{#if:{{{csgo|}}}|
+
{{KV|Disable for Xbox 360|intn=disableX360|bool|If this entity should automatically be given the 'Disable' input on the Xbox 360 version of Source.|nofgd=1|since=L4D2}}
 +
| }}<!-- IF: CSGO -->{{#if:{{{csgo|}}}|
 
{{KV|Is Automatic-Aim Target|intn=is_autoaim_target|bool|If set to 1, this entity will slow down aiming movement for consoles and joystick controllers when the entity is under the crosshairs.|nofgd=1|since=CSGO}}
 
{{KV|Is Automatic-Aim Target|intn=is_autoaim_target|bool|If set to 1, this entity will slow down aiming movement for consoles and joystick controllers when the entity is under the crosshairs.|nofgd=1|since=CSGO}}
|<!-- ELSE: -->
+
| }}<!-- IF: NOT BASE, L4D2 and CSGO -->{{#if:{{{base|}}}||{{#if:{{{l4d2|}}}||{{#if:{{{csgo|}}}||
{{KV|Disable for Xbox 360|intn=disableX360|bool|If this entity should automatically be given the 'Disable' input on the Xbox 360 version of Source.|nofgd=1|since=L4D2}}
 
 
{{KV|Entity Scripts|intn=vscripts|scriptlist|Space delimited list of [[VScript]] files (without file extension) that are executed after all entities have spawned. The scripts are all executed in the same script scope, later ones overwriting any identical variables and functions.|since=L4D2}}
 
{{KV|Entity Scripts|intn=vscripts|scriptlist|Space delimited list of [[VScript]] files (without file extension) that are executed after all entities have spawned. The scripts are all executed in the same script scope, later ones overwriting any identical variables and functions.|since=L4D2}}
 
{{KV|Script think function|intn=thinkfunction|string|Name of a function in this entity's script which will be called automatically every 100 milliseconds (ten times a second) for the duration of the script. It can be used to create timers or to simulate autonomous behavior. The return value (if present) will set the time until the next call. Try to avoid [[expensive]] operations in this function, as it may cause performance problems.|since=L4D2}}
 
{{KV|Script think function|intn=thinkfunction|string|Name of a function in this entity's script which will be called automatically every 100 milliseconds (ten times a second) for the duration of the script. It can be used to create timers or to simulate autonomous behavior. The return value (if present) will set the time until the next call. Try to avoid [[expensive]] operations in this function, as it may cause performance problems.|since=L4D2}}
 
{{KV|[[Lag Compensation]]|intn=LagCompensate|boolean|Set to '''Yes''' to lag compensate this entity. Should be used very sparingly!|nofgd=1|since=L4D2}}
 
{{KV|[[Lag Compensation]]|intn=LagCompensate|boolean|Set to '''Yes''' to lag compensate this entity. Should be used very sparingly!|nofgd=1|since=L4D2}}
}}}}}}</includeonly>
+
{{KV|Disable for Xbox 360|intn=disableX360|bool|If this entity should automatically be given the 'Disable' input on the Xbox 360 version of Source.|nofgd=1|since=L4D2}}
 +
{{KV|Is Automatic-Aim Target|intn=is_autoaim_target|bool|If set to 1, this entity will slow down aiming movement for consoles and joystick controllers when the entity is under the crosshairs.|nofgd=1|since=CSGO}}
 +
| }}}}}}</includeonly>
 
<noinclude>
 
<noinclude>
 
{{documentation}}
 
{{documentation}}
 
<!-- Add categories to the /doc subpage, not here -->
 
<!-- Add categories to the /doc subpage, not here -->
 
</noinclude>
 
</noinclude>

Latest revision as of 00:13, 8 May 2021


Template icon Template documentation[view] [edit] [history] [purge]

Info holder for all keyvalues that inherit theCBaseEntity class. Parameters are vital to display the appropiate info, because new games have added new features throughout the years. See Help:Templates for more info on named parameters.

Note.png Note: If you want to edit something on this template, please make sure you edit it in both places. Per-game keyvalues are duplicated, for technical reasons. Also see FGD Template Prototype.
Note.png Note: Some CBaseEntity keyvalues are not covered here. See the talk page.

Usage

All parameters for this template:

  • base- Shows only information relevant to when it was initially added for the first time
  • l4d2- Include info specific to <Left 4 Dead 2> (VScripts)
  • csgo- Include info specific to <Counter-Strike: Global Offensive> (Auto-aim targets)
  • brush- Include info specific to all sorts of brushes. For extra keys applicable only to visible brushes, use Template:KV visiblebrush in conjunction.
Show Deprecated:


These must be used in a specific syntax; All the parameters must be given a value of 1, like for example:l4d2=1for <Left 4 Dead 2> specific info. Refer to the Examples section.

Examples

Show info specific to a game <Counter-Strike: Global Offensive>

This makes information relevant only to <Counter-Strike: Global Offensive> be displayed.

{{KV BaseEntity|csgo=1}}
will:

Show info for its base

Information relevant only to this key at / before <Half-Life 2: Episode Two><Half-Life 2: Episode Two> is displayed.

{{KV BaseEntity|base=1}}
will:

Show info related to brushes

Extra brush related keyvalues are displayed with this.

{{KV BaseEntity|brush=1}}
will:

Show information for all games

Shows every game information for this key that this template can display. (Except for brush related)

{{KV BaseEntity}}
will:

See Also



Base:

Classname (classname) <string>
The classname defines the type of entity. Classnames can be changed using AddOutput, which will influence how the engine deals with the entity in certain circumstances.
Name (targetname) <string>
The name that other entities refer to this entity by.
Global Entity Name (globalname) <string>
Name by which this entity is linked to another entity in a different map. When the player transitions to a new map, entities in the new map with globalnames matching entities in the previous map will have the previous map's state copied over their state.
Parent (parentname) <targetname>
Specifies a movement parent. An entity will maintain its initial offset from its parent. An attachment point can be added to the end of the name, separated by a comma. Every entity can be parented, even point entities. Entities which are parented will be forced to transition to the next map, such as from a trigger_transition. Some entities which aren't intended to be parented may not function correctly. phys_constraint can be used as a workaround to parenting.
Origin (X Y Z) (origin) <coordinates>
The position of this entity's center in the world. Rotating entities typically rotate around their origin.
Pitch Yaw Roll (X Y Z) (angles) <angle>
This entity's orientation in the world. Pitch is rotation around the Y axis, yaw is the rotation around the Z axis, roll is the rotation around the X axis.
Note.png Note: This works on brush entities, although Hammer doesn't show the new angles.
Flags (spawnflags) <integer>
Toggles features of an entity, its specific number is determined by the combination of flags added.
Response Contexts (ResponseContext) <string>
Pre-defined response system contexts for this entity. Format is key:value,key:value,.... Contexts may be filtered.
Effects (effects) <integer> !FGD
Combination of effect flags to use.
Hammer ID (hammerid) <integer> !FGD
The entity's Hammer ID. Mainly used by plugins and debugging commands, such as ent_keyvalue. Entities spawned at run-time are not assigned any Hammer ID.
Entity Scripts (vscripts) <scriptlist> (in all games since <Left 4 Dead 2>)
Space delimited list of VScript files (without file extension) that are executed after all entities have spawned. The scripts are all executed in the same script scope, later ones overwriting any identical variables and functions.
Script think function (thinkfunction) <string> (in all games since <Left 4 Dead 2>)
Name of a function in this entity's script which will be called automatically every 100 milliseconds (ten times a second) for the duration of the script. It can be used to create timers or to simulate autonomous behavior. The return value (if present) will set the time until the next call. Try to avoid expensive operations in this function, as it may cause performance problems.
Lag Compensation (LagCompensate) <boolean> (in all games since <Left 4 Dead 2>) !FGD
Set to Yes to lag compensate this entity. Should be used very sparingly!
Disable for Xbox 360 (disableX360) <boolean> (in all games since <Left 4 Dead 2>) !FGD
If this entity should automatically be given the 'Disable' input on the Xbox 360 version of Source.
Is Automatic-Aim Target (is_autoaim_target) <boolean> (in all games since <Counter-Strike: Global Offensive>) !FGD
If set to 1, this entity will slow down aiming movement for consoles and joystick controllers when the entity is under the crosshairs.