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

From Valve Developer Community
Jump to navigation Jump to search
m (Added Template:Lang)
(Updated "thinkfunction" and "classname"; Commented out: "disablex360", "hammerid", "modelindex", "globalname", "mins" and "maxs" (thankfully the "Bounding box" page describes them already), "ResponseContexts" (the page does describe it, kinda?))
Line 6: Line 6:
<!-- IF: BRUSH -->
<!-- IF: BRUSH -->
{{#if:{{{brush|}}}|{{minititle|Brush}}
{{#if:{{{brush|}}}|{{minititle|Brush}}
{{KV|Minimum Bounding Box Size|intn=mins|vector|nofgd=1}}
{{KV|Collisions|intn=solid|choices|Method of collision for this entity. {{ExpandBox|
{{KV|Maximum Bounding Box Size|intn=maxs|vector|Starting at the brush's origin, mark a bounding box's corner as this far away. Both are required at the same time so one side of the bounding box isn't empty.|nofgd=1}}
<!-- idk why upright won't work, and the text always shows collapse at the doc page, can't do anything about it -->
:{{ExpandBox| [[File:BoundingBoxMinsMaxs.png|right|400x300px|Graph of 'mins' and 'maxs']] | side=right | noendlinebreak=1 | expandtext=View Graph | collapsetext=Hide Graph }}
:{{note|To translate a brush's size in Hammer to these keys, first divide the size value shown in Hammer by 2. Apply the result to the<code>maxs</code>key, then apply the inverted variant (multiply / divide by -1) for the<code>mins</code>key.}}
:{{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.
:*0: None
:*0: None
:*1: BSP ([[QPhysics]]) {{Not in FGD}} {{bug|In {{portal2}}, if an entity using QPhysics collisions is hit by [[Gel]], the game will crash!}}
:*1: BSP ([[QPhysics]]) {{Not in FGD}} {{bug|In {{portal2}}, if an entity using QPhysics collisions is hit by [[Gel]], the game will crash!}}
:*2: [[Bounding box|Bounding Box]]
:*2: [[Bounding box|Bounding Box]]
:*3: [[Bounding box|Oriented Bounding Box]] (Use for runtime spawned brush entities meant to be rotated) {{Not in FGD}}
:*3: Oriented Bounding Box (Use for runtime spawned brush entities meant to be rotated) {{Not in FGD}}
:*4: [[Bounding box|Oriented Bounding Box]], constrained to [[QAngle|Yaw]] only {{Not in FGD}}
:*4: Oriented Bounding Box but constrained to [[QAngle|Yaw]] only {{Not in FGD}}
:*5: Custom/Test (Usually no collision with anything) {{Not in FGD}}
:*5: Custom/Test (Usually no collision with anything) {{Not in FGD}}
:*6: [[VPhysics]]
:*6: [[VPhysics]]}}
| }}
| }}
<!-- We should make a new page for "model index"? -->
<!-- "mins" and "maxs" used to be here, but the "Bounding Box" page already describes it -->
<!-- We should make a new page for "model index"?
{{KV|Model Index|intn=modelindex|short|Given the number index from dumping the<code>cl_precacheinfo modelprecache</code>table, sets entity model to of the index. {{warning|If an entity has animations that ''will be'' played, then the set model also must have its own sequences, else the game crashes.}}|nofgd=1}}
{{KV|Model Index|intn=modelindex|short|Given the number index from dumping the<code>cl_precacheinfo modelprecache</code>table, sets entity model to of the index. {{warning|If an entity has animations that ''will be'' played, then the set model also must have its own sequences, else the game crashes.}}|nofgd=1}}
-->
| }}
| }}
<!--
<!--
   ++ Base ++
   ++ Base ++
-->
-->
{{minititle|Base}}
{{ScrollBox|title=Base|
{{KV|[[targetname|Name]]|intn=targetname|string|The name that other entities use to refer to this entity.}}
{{KV|[[targetname|Name]]|intn=targetname|string|The name that other entities use to refer to this entity.}}
<!-- This probably have too little use cases, we'll have to see if someone objects.
{{KV|Global Entity Name|intn=globalname|string| When the player transitions to a new map, entities in the new map with matching globalnames will have their previous map's states copied over to it.}}
-->
{{KV|[[Parent]]|intn=parentname|targetname|Maintain the same initial offset to this entity. An attachment point can also be used if separated by a comma at the end. (<code>parentname [targetname],[attachment]</code>) {{tip|Entities transition to the next map with their parents}}{{tip|{{ent|phys_constraint}}can be used as a workaround if parenting fails.}}}}
{{KV|[[Parent]]|intn=parentname|targetname|Maintain the same initial offset to this entity. An attachment point can also be used if separated by a comma at the end. (<code>parentname [targetname],[attachment]</code>) {{tip|Entities transition to the next map with their parents}}{{tip|{{ent|phys_constraint}}can be used as a workaround if parenting fails.}}}}
{{KV|Global Entity Name|intn=globalname|string| When the player transitions to a new map, entities in the new map with matching globalnames will have their previous map's states copied over to it.}}
{{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|Hammer does not move the entities accordingly only in the editor.}}}}
{{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|Hammer does not move the entities accordingly only in the editor.}}}}
{{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.}}}}
<!-- This probably have too little use cases, we'll have to see if someone objects. Thankfully the page already describes its existence.
{{KV|[[ResponseContext|Response Contexts]]|intn=ResponseContext|string|Pre-defined response system contexts; Format is <code>[key]:[value],[key]:[value],...</code>and so on. {{tip|Can also be [[filter_activator_context|filtered for or against!]]}}}}
{{KV|[[ResponseContext|Response Contexts]]|intn=ResponseContext|string|Pre-defined response system contexts; Format is <code>[key]:[value],[key]:[value],...</code>and so on. {{tip|Can also be [[filter_activator_context|filtered for or against!]]}}}}
{{KV|[[Classname]]|intn=classname|string|Determines the characteristics of the entity ''before'' it spawns. {{tip|Changing classnames using the{{ent|AddOutput}}input can still influence the game's code, like making the classname match one element in the [[S_PreserveEnts]] list will make the entity persists on new rounds!}}|nofgd=1}}
-->
{{KV|[[Classname]]|intn=classname|string|Determines the characteristics of the entity ''before'' it spawns. {{tip|Changing this on runtime still has use, like making matching an entry in [[S_PreserveEnts]] will persist the entity on new rounds!}}|nofgd=1}}
{{KV|[[Flag|Flags]]|intn=spawnflags|integer|Toggles exclusive features of an entity, its specific number is determined by the combination of flags added.|nofgd=1}}
{{KV|[[Flag|Flags]]|intn=spawnflags|integer|Toggles exclusive features of an entity, its specific number is determined by the combination of flags added.|nofgd=1}}
{{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. Sourcemod scripters don't use "hammerid" often either
{{KV|Local Time|intn=ltime|float|The local time of the entity, independent of the global clock. Used mainly for physics calculations.|nofgd=1}}
{{KV|Local Time|intn=ltime|float|The local time of the entity, independent of the global clock. Used mainly for physics calculations.|nofgd=1}}
{{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 unique [[Hammer]] ID that's auto-generated on map compiles. Mainly used by plugins or debugging commands (like the'''<code>ent_keyvalue</code>'''command). Run-time spawned entities don't have a Hammer ID.|nofgd=1}}
-->
-->
{{KV|Hammer ID|intn=hammerid|int|The entity's unique [[Hammer]] ID that's auto-generated on map compiles. Mainly used by plugins or debugging commands (like the'''<code>ent_keyvalue</code>'''command). Run-time spawned entities don't have a Hammer ID.|nofgd=1}}
<!--
<!--
   ++ Game Specifics ++
   ++ Game Specifics ++
Line 47: Line 47:
<!-- IF: L4D2 -->{{#if:{{{l4d2|}}}|
<!-- IF: L4D2 -->{{#if:{{{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|[[Entity_Scripts#Thinker_Functions|Thinking function]]|intn=thinkfunction|string|Name of the function within this entity's script that'll be called automatically every 100 milliseconds, or a user-defined interval if the function returns a number. 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}}
<!-- Its 360, so it goes away
{{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}}
-->
| <!-- ELSE IF: NOT BASE [CSGO] -->{{#if:{{{base|}}}||
| <!-- ELSE IF: NOT BASE [CSGO] -->{{#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|[[Entity_Scripts#Thinker_Functions|Thinking function]]|intn=thinkfunction|string|Name of the function within this entity's script that'll be called automatically every 100 milliseconds, or a user-defined interval if the function returns a number. 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}}
<!-- Its 360, so it goes away
{{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}}
-->
{{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}}
| }} }}</includeonly>
| }} }}
}}</includeonly>
<noinclude>
<noinclude>
{{documentation}}
{{documentation}}
<!-- Add categories to the /doc subpage, not here -->
<!-- Add categories to the /doc subpage, not here -->
</noinclude>
</noinclude>

Revision as of 13:30, 21 November 2021

English (en)中文 (zh)Translate (Translate)


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