Generic Keyvalues, Inputs and Outputs/Keyvalues: Difference between revisions
Jump to navigation
Jump to search
No edit summary |
No edit summary |
||
Line 1: | Line 1: | ||
{{Lang|Template:KV BaseEntity}} | {{Lang|Template:KV BaseEntity}} | ||
{{Documentation}} | {{Documentation}} | ||
== Tests == | |||
{{KV|start}} | {{KV|start}} | ||
{{KV BaseEntity|new=1| | {{KV BaseEntity|new=1|spawnflags=2}} | ||
{{KV|end}} | {{KV|end}} | ||
{{KV | <includeonly><onlyinclude>{{#if:{{{new|}}}|<!-- | ||
-->{{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>) {{ModernTip|Entities transition to the next map with their parents}}{{ModernTip|{{Ent|phys_constraint}} can be used as a workaround if parenting fails.}}}} | |||
| brush = {{KV|new=1|solid|choices|src=Base|Collisions|Method of collision for this entity. | {{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.{{ModernNote|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.{{ModernNote|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. {{ModernTip|Changing this on runtime still has use, like making matching an entry in [[S_PreserveEnts]] will persist the entity on new rounds!}}}} | |||
{{#if:{{{brush| {{#ifeq:{{str left|{{ROOTPAGENAME}}|4}}|Func|1|}} }}} | |||
|{{KV|new=1|solid|choices|src=Base|Collisions|value=Use VPhysics|rawValue={{Code|6}}|Method of collision for this entity. | |||
'''Values:''' | '''Values:''' | ||
Line 21: | Line 29: | ||
* 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]]}}{{KV| | * 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|effects|int|src=Base|[[Effect flags|Effects]]|nofgd=1|Combination of effect flags to use.}} | ||
{{#if:{{{l4d2|}}} | |||
| {{KV|new=1|vscripts|scriptlist|src=Base|Entity Scripts|since=L4D2|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|new=1| | {{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|vscripts|scriptlist|src=Base|Entity Scripts|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|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!}} | ||
| {{#switch:{{{base|}}}|0=|{{KV|new=1|vscripts|scriptlist|src=Base|Entity Scripts|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|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 34: | Line 48: | ||
{{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}} | ||
|}}<!-- | }}}}|}}<!-- | ||
Line 54: | Line 68: | ||
================================================================= | ================================================================== | ||
DEPRECATED DEPRECATED DEPRECATED DEPRECATED DEPRECATED DEPRECATED | DEPRECATED DEPRECATED DEPRECATED DEPRECATED DEPRECATED DEPRECATED: | ||
================================================================= | ================================================================== | ||
-->{{#if:{{{new|}}}||{{ScrollBox|title=Base|noscroll={{{noscroll|1}}}|<!-- | -->{{#if:{{{new|}}}||{{ScrollBox|title=Base|noscroll={{{noscroll|1}}}|<!-- | ||
Line 85: | Line 99: | ||
{{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>) {{ModernTip|Entities transition to the next map with their parents}}{{ModernTip|{{ | {{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>) {{ModernTip|Entities transition to the next map with their parents}}{{ModernTip|{{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.{{ModernNote|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.{{ModernNote|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.{{ModernNote|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.{{ModernNote|This works on brush entities, although Hammer doesn't show the new angles.}}}} |