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

From Valve Developer Community
Jump to navigation Jump to search
m (Needed to convert empty string to 0 for #ifexpr.)
(use strings from strings subpage instead)
Line 10: Line 10:
<includeonly><onlyinclude>{{#ifeq:{{{new|0}}}|0||<!-- if new != 0
<includeonly><onlyinclude>{{#ifeq:{{{new|0}}}|0||<!-- if new != 0


-->{{KV|new=1|targetname|string|src=Base|[[targetname|Name]]|The name that other entities use to refer to this entity.}}
-->{{KV|new=1|targetname|string|src=Base|[[targetname|Name]]|{{KV BaseEntity/strings|KeyTargetnameDesc}}}}


{{KV|new=1|parentname|targetname|src=Base|[[Parent]]|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|new=1|parentname|targetname|src=Base|[[Parent]]|{{KV BaseEntity/strings|KeyParentnameDesc}}}}


{{KV|new=1|origin|coordinates|src=Base|[[Origin]] (X Y Z)|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|new=1|origin|coordinates|src=Base|[[Origin]] (X Y Z)|{{KV BaseEntity/strings|KeyOriginDesc}}}}


{{KV|new=1|angles|angle|src=Base|[[Pitch Yaw Roll]] (X Y Z)|value=0 0 0|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|new=1|angles|angle|src=Base|[[Pitch Yaw Roll]] (X Y Z)|value=0 0 0|{{KV BaseEntity/strings|KeyAnglesDesc}}}}


{{KV|new=1|classname|string|src=Base|[[Classname]]|nofgd=1|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!}}}}
{{KV|new=1|classname|string|src=Base|[[Classname]]|nofgd=1|{{KV BaseEntity/strings|KeyClassnameDesc}}}}


{{#ifeq:{{{brush| {{#ifeq:{{lc:{{str left|{{ROOTPAGENAME}}|4}} }}|func|1|0}} }}}|0||<!-- if pagename starts with "func", use {{{brush|1}}}, otherwise {{{brush|0}}} -->
{{#ifeq:{{{brush| {{#ifeq:{{lc:{{str left|{{ROOTPAGENAME}}|4}} }}|func|1|0}} }}}|0||<!-- if pagename starts with "func", use {{{brush|1}}}, otherwise {{{brush|0}}} -->
{{KV|new=1|solid|choices|src=Base|Collisions|value=Use VPhysics|rawValue={{Code|6}}|Method of collision for this entity.
{{KV|new=1|solid|choices|src=Base|Collisions|value=Use VPhysics|rawValue={{Code|6}}|{{KV BaseEntity/strings|KeySolidDesc}}
 
'''Values:'''
* 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!|only=portal2}}
* 2: [[Bounding box|Bounding Box]]
* 3: Oriented Bounding Box (Use for runtime spawned brush entities meant to be rotated) {{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}}
* 6: [[VPhysics]]}}
}}
}}


{{KV|new=1|spawnflags|integer|src=Base|[[Flag|Flags]]|value={{{spawnflags|}}}|nofgd=1|Toggles exclusive features of an entity, its specific number is determined by the combination of flags added.}}
{{KV|new=1|spawnflags|integer|src=Base|[[Flag|Flags]]|value={{{spawnflags|}}}|nofgd=1|{{KV BaseEntity/strings|KeyFlagsDesc}}}}


{{KV|new=1|effects|int|src=Base|[[Effect flags|Effects]]|nofgd=1|Combination of effect flags to use.}}
{{KV|new=1|effects|int|src=Base|[[Effect flags|Effects]]|nofgd=1|{{KV BaseEntity/strings|KeyEffectsDesc}}}}
{{#ifeq:{{{l4d2|0}}}|0||<!-- if l4d2 != 0
{{#ifeq:{{{l4d2|0}}}|0||<!-- if l4d2 != 0


-->{{KV|new=1|vscripts|scriptlist|src=Base|Entity Scripts|since=L4D2|also={{tf2}}|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. Scripts executed on the [[worldspawn]] entity will be placed in root scope.}}
-->{{KV|new=1|vscripts|scriptlist|src=Base|Entity Scripts|since=L4D2|also={{tf2}}|{{KV BaseEntity/strings|KeyVScriptsDesc}}}}


{{KV|new=1|thinkfunction|string|src=Base|[[Entity_Scripts#Thinker_Functions|Think function]]|since=L4D2|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.}}
{{KV|new=1|thinkfunction|string|src=Base|[[Entity_Scripts#Thinker_Functions|Think function]]|since=L4D2|{{KV BaseEntity/strings|KeyThinkFunctionDesc}}}}


{{KV|new=1|LagCompensate|boolean|src=Base|[[Lag Compensation]]|nofgd=1|since=L4D2|Set to '''Yes''' to lag compensate this entity. Should be used very sparingly!}}<!--
{{KV|new=1|LagCompensate|boolean|src=Base|[[Lag Compensation]]|nofgd=1|since=L4D2|{{KV BaseEntity/strings|KeyLagCompensateDesc}}}}<!--


-->}}<!--
-->}}<!--
Line 48: Line 39:
-->{{#ifeq:{{{base|0}}}|0|<!-- if base == 0
-->{{#ifeq:{{{base|0}}}|0|<!-- if base == 0


-->{{KV|new=1|vscripts|scriptlist|src=Base|Entity Scripts|since=L4D2|also={{tf2}}|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. Scripts executed on the [[worldspawn]] entity will be placed in root scope.}}
-->{{KV|new=1|vscripts|scriptlist|src=Base|Entity Scripts|since=L4D2|also={{tf2}}|{{KV BaseEntity/strings|KeyVScriptsDesc}}}}


{{KV|new=1|thinkfunction|string|src=Base|[[Entity_Scripts#Thinker_Functions|Think function]]|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|also={{tf2}}}}
{{KV|new=1|thinkfunction|string|src=Base|[[Entity_Scripts#Thinker_Functions|Think function]]|{{KV BaseEntity/strings|KeyThinkFunctionDesc}}|since=L4D2|also={{tf2}}}}


{{KV|new=1|LagCompensate|boolean|src=Base|[[Lag Compensation]]|Set to '''Yes''' to lag compensate this entity. Should be used very sparingly!|nofgd=1|since=L4D2}}
{{KV|new=1|LagCompensate|boolean|src=Base|[[Lag Compensation]]|{{KV BaseEntity/strings|KeyLagCompensateDesc}}|nofgd=1|since=L4D2}}


{{KV|new=1|is_autoaim_target|bool|src=Base|Is Automatic-Aim Target|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|new=1|is_autoaim_target|bool|src=Base|Is Automatic-Aim Target|{{KV BaseEntity/strings|KeyIs_autoaim_targetDesc}}|nofgd=1|since=CSGO}}
}}<!-- endif base == 0
}}<!-- endif base == 0
-->}}<!-- endif new != 0
-->}}<!-- endif new != 0

Revision as of 21:03, 10 January 2024

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

Tests

start ([todo internal name (i)])


end ([todo internal name (i)])