Generic Keyvalues, Inputs and Outputs/Keyvalues: Difference between revisions

From Valve Developer Community
Jump to navigation Jump to search
(When making a rotated trigger on the fly)
m (3 separate if statements --> 1 if statement only, necessary to remove the weird extra spaces; Edited some description of keyvalues)
Line 7: Line 7:
{{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|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, 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}}
{{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, with 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 shown in Hammer by 2. Then, apply the result to the<code>maxs</code>key, and invert the number (Multiply / Divide by -1) and apply it for the<code>mins</code>key.}}
:{{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).}}
{{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}}
Line 15: Line 15:
:*3: [[Bounding box|Oriented Bounding Box]]
:*3: [[Bounding box|Oriented Bounding Box]]
:*4: [[Bounding box|Oriented Bounding Box]], constrained to [[QAngle|Yaw]] only
:*4: [[Bounding box|Oriented Bounding Box]], constrained to [[QAngle|Yaw]] only
:*5: Custom/Test
:*5: Custom/Test; Does nothing but may do something for a small minority
:*6: [[VPhysics]]
:*6: [[VPhysics]]
::{{todo|When is a good time to apply Oriented Bounding Box manually..?}}
{{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}}
{{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}}
| }}
| }}
Line 23: Line 24:
-->
-->
{{minititle|Base}}
{{minititle|Base}}
{{KV|[[Classname]]|intn=classname|string|The classname defines the type of entity. Classnames can be changed using {{ent|AddOutput}}, which will influence how the engine deals with the entity in certain circumstances.}}
{{KV|[[Classname]]|intn=classname|string|The classname defines the type of entity. Classnames can be changed using{{ent|AddOutput}}input, which may influence how the engine deals with the entity in certain circumstances.}}
{{KV|[[targetname|Name]]|intn=targetname|string|The name that other entities refer to this entity by.}}
{{KV|[[targetname|Name]]|intn=targetname|string|The name that other entities refer to this entity by.}}
{{KV|Global Entity Name|intn=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.}}
{{KV|Global Entity Name|intn=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.}}
{{KV|[[Parent]]|intn=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 {{ent|trigger_transition}}. Some entities which aren't intended to be parented may not function correctly. {{ent|phys_constraint}} can be used as a workaround to parenting.}}
{{KV|[[Parent]]|intn=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 {{ent|trigger_transition}}. Some entities which aren't intended to be parented may not function correctly. {{ent|phys_constraint}} can be used as a workaround to parenting.}}
{{KV|[[Origin]] (X Y Z)|intn=origin|coordinates|The position of this entity's center in the world. Rotating entities typically rotate around their origin.}}
{{KV|[[Origin]] (X Y Z)|intn=origin|coordinates|The position of this entity's center in the world. Rotating entities typically rotate around their origin.{{note|While this can override positions of where some entities spawn at, Hammer does not move the entities accordingly.}}}}
{{KV|[[Pitch Yaw Roll]] (X Y Z)|intn=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|This works on brush entities, although Hammer doesn't show the new angles.}}}}
{{KV|[[Pitch Yaw Roll]] (X Y Z)|intn=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|This works on brush entities, although Hammer doesn't show the new angles.}}}}
{{KV|[[Flag|Flags]]|intn=spawnflags|integer|Toggles features of an entity, its specific number is determined by the combination of flags added.}}
{{KV|[[Flag|Flags]]|intn=spawnflags|integer|Toggles features of an entity, its specific number is determined by the combination of flags added.}}
{{KV|[[ResponseContext|Response Contexts]]|intn=ResponseContext|string|Pre-defined response system contexts for this entity. Format is <code>key:value,key:value,...</code>. Contexts may be [[filter_activator_context|filtered]].}}
{{KV|[[ResponseContext|Response Contexts]]|intn=ResponseContext|string|Pre-defined response system contexts. Format is <code>key:value,key:value,...</code>and so on. Contexts may be [[filter_activator_context|filtered]].}}
{{KV|[[Effect flags|Effects]]|intn=effects|int|Combination of effect flags to use.|nofgd=1}}
{{KV|[[Effect flags|Effects]]|intn=effects|int|Combination of effect flags to use.|nofgd=1}}
<!-- I'm not sure what the use cases of these 2 are, so ill hide them for now. Not too much of a harm to show "hammerid" for the plugin / sourcepawn peeps
<!-- I'm not sure what the use cases of these 2 are, so ill hide them for now. Not too much of a harm to show "hammerid" for the plugin / sourcepawn peeps
Line 36: Line 37:
{{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>'''. Entities spawned at run-time are not assigned any Hammer ID.|nofgd=1}}
{{KV|Hammer ID|intn=hammerid|int|The entity's [[Hammer]] ID, which is auto-generated on map compiles. Mainly used by plugins and debugging commands, such as the'''<code>ent_keyvalue</code>'''command. Run-time spawned entities aren't assigned a Hammer ID.|nofgd=1}}
<!--
<!--
   ++ Game Specifics ++
   ++ Game Specifics ++
Line 45: Line 46:
{{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}}
{{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|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|}}}|
| <!-- ELSE 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}}
| }}<!-- IF: NOT BASE, L4D2 and CSGO -->{{#if:{{{base|}}}||{{#if:{{{l4d2|}}}||{{#if:{{{csgo|}}}||
| <!-- ELSE IF: NOT BASE -->{{#if:{{{base|}}}||
{{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}}

Revision as of 04:45, 17 May 2021


English (en)Deutsch (de)Esperanto (eo)Español (es)Français (fr)Suomi (fi)Hrvatski (hr)Magyar (hu)Italiano (it)日本語 (ja)한국어 (ko)Nederlands (nl)Polski (pl)Português (pt)Português do Brasil (pt-br)Русский (ru)Slovenčina (sk)Svenska (sv)Türkçe (tr)Українська (uk)Tiếng Việt (vi)中文 (zh)中文(臺灣) (zh-tw)
Icon-translate.png Available doc translations
Info.png
The Generic Keyvalues, Inputs and Outputs/Keyvalues/doc documentation page does not exist.
English documentation will be displayed instead, which you can translate using Google Translate (or similar software). If there is nothing after this message, most likely the documentation does not exist even in English.
Generic Keyvalues, Inputs and Outputs/Keyvalues/doc