Generic Keyvalues, Inputs and Outputs/Keyvalues: Difference between revisions
Jump to navigation
Jump to search
m ({{documentation}} -> {{doc}}) |
(Changed a Tip to Note because for some reason it broke ExpandBoxes and ScrollBoxes. Used ifeq instead of if in some cases. Replaced modern templates with old counterpart.) |
||
Line 8: | Line 8: | ||
{{KV|end}} | {{KV|end}} | ||
<includeonly><onlyinclude>{{# | <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]]|The name that other entities use to refer to this entity.}} | ||
{{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>) {{ | {{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|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.{{ | {{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|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.{{ | {{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|classname|string|src=Base|[[Classname]]|nofgd=1|Determines the characteristics of the entity ''before'' it spawns. {{ | {{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!}}}} | ||
{{# | {{#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. | |||
'''Values:''' | '''Values:''' | ||
* 0: None | * 0: None | ||
* 1: BSP ([[QPhysics]]) {{Not in FGD}} {{ | * 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]] | * 2: [[Bounding box|Bounding Box]] | ||
* 3: 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}} | ||
Line 30: | Line 31: | ||
* 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]]}} | ||
}} | |||
{{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|Toggles exclusive features of an entity, its specific number is determined by the combination of flags added.}} | ||
{{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|Combination of effect flags to use.}} | ||
{{# | {{#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|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|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|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|Set to '''Yes''' to lag compensate this entity. Should be used very sparingly!}}<!-- | ||
-->}}<!-- | |||
-->{{#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|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]]|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}}}} | ||
Line 48: | Line 55: | ||
{{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|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}} | ||
}} | }}<!-- endif base == 0 | ||
-->}}<!-- endif new != 0 | |||
Line 72: | Line 80: | ||
================================================================== | ================================================================== | ||
-->{{# | -->{{#ifeq:{{{new|0}}}|0|<!-- if new == 0 | ||
-->{{ScrollBox|title=Base|noscroll={{{noscroll|1}}}|<!-- | |||
++ BRUSH ++ | ++ BRUSH ++ | ||
-->{{# | -->{{#ifeq: {{{brush| {{#ifeq: {{lc:{{str left|{{ROOTPAGENAME}}|4}} }} | func | 1 | 0 }} }}} |0||<!-- if pagename starts with "func" use {{{brush|1}}}, otherwise {{{brush|0}}} --> | ||
{{KV|Collisions|intn=solid|choices|Method of collision for this entity. {{ExpandBox| | {{KV|Collisions|intn=solid|choices|Method of collision for this entity.<!-- | ||
-->{{ExpandBox| | |||
:*0: None | :*0: None | ||
:*1: BSP ([[QPhysics]]) {{Not in FGD}} {{ | :*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]] | :*2: [[Bounding box|Bounding Box]] | ||
:*3: 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: Oriented Bounding Box but 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]]<!-- | ||
-->}}<!-- end ExpandBox | |||
-->}}<!-- end KV --> | |||
<!-- "mins" and "maxs" used to be here, but the "Bounding Box" page already describes it --> | <!-- "mins" and "maxs" used to be here, but the "Bounding Box" page already describes it --> | ||
<!-- We should make a new page for "model index"? | <!-- 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. {{ | {{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}} | ||
--> | --> | ||
<br /> | <br /> | ||
}}<!-- END brush != 0 | |||
++ BASE ++ | ++ BASE ++ | ||
Line 99: | Line 111: | ||
{{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|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>) {{ | {{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|[[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|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.{{ | {{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. | 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. {{ | {{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. {{ | {{KV|[[Classname]]|intn=classname|string|nofgd=1|Determines the characteristics of the entity ''before'' it spawns. {{Note<!--This used to be a Tip but it broke ExpandBoxes/ScrollBoxes... why?-->|Changing this on runtime still has use, like making matching an entry in [[S_PreserveEnts]] will persist the entity on new rounds!}}}} | ||
{{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}} | ||
Line 118: | Line 130: | ||
IF: L4D2 | IF: L4D2 | ||
-->{{#if:{{{ | -->{{#ifeq:{{{l4d2|0}}}|0|<!-- if l4d2 == 0 | ||
{{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#Thinker_Functions|Think 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}} | -->{{#ifeq:{{{base|0}}}|0|<!-- if base == 0 | ||
IF: NOT L4D2 && NOT BASE [CSGO] | |||
--> | |||
{{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. Scripts executed on the [[worldspawn]] entity will be placed in root scope.|since=L4D2|also={{tf2}}}} | |||
{{KV|[[Entity_Scripts#Thinker_Functions|Think 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|also={{tf2}}}} | |||
{{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 | <!-- 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}}<!-- | ||
-->}}<!-- end if base == 0 | |||
-->|<!-- else (l4d2 != 0) | |||
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 | {{KV|[[Entity_Scripts#Thinker_Functions|Think 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|[[Entity_Scripts#Thinker_Functions|Think 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 | <!-- 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}} | ||
-->}}</onlyinclude></includeonly> | -->}}<!-- end #ifeq l4d2 | ||
-->}}<!-- end ScrollBox | |||
-->}}<!-- end ifeq new == 0 | |||
--></onlyinclude></includeonly> | |||
{{ScrollBox| | |||
{{KV BaseEntity}} | |||
}} | |||
---- | |||
{{ExpandBox| | |||
{{KV BaseEntity}} | |||
}} |