User:Nescius/sandbox/test21: Difference between revisions

From Valve Developer Community
Jump to navigation Jump to search
No edit summary
No edit summary
 
(6 intermediate revisions by the same user not shown)
Line 1: Line 1:
== Keyvalues ==
<includeonly>{{bug|{{subst:#if:{{{tested|}}}|tested={{{tested}}}|hidetested=1}}|{{{1}}}{{subst:#if:{{{only|}}}|{{subst:!}}only={{{only}}}}}{{subst:#if:{{{since|}}}|{{subst:!}}since={{{since}}}}}{{subst:#if:{{{fixed|}}}|{{subst:!}}fixed={{{fixed}}}}}}}</includeonly>
{{KV|Collisions|intn=solid|choices|Method of collision for this entity.
 
'''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|[[targetname|Name]]|intn=targetname|string|The name that other entities use to refer to this entity.}}
{{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.{{bug|Hammer does not move point entities accordingly in the editor.}}}}
{{KV|[[Pitch Yaw Roll]] (Y Z X)|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|[[Classname]]|intn=classname|string|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|[[Spawnflags]]|intn=spawnflags|flags|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|flags|Combination of effect flags to use.|nofgd=1}}
{{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|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}}
 
 
== Inputs ==
{{I|AddContext|Adds to the entity's list of [[Response System|response contexts]]. See [[Context|Context]].|param=string}}
{{I|{{Lx|AddOutput}}|Assigns a new keyvalue/output on this entity. For keyvalues, some rely on extra necessary code to be ran and won't work if its simply just changed through this input. There is a strict format that must be followed:{{Expand|<syntaxhighlight lang="PowerShell">
// Format of changing KeyValues: "AddOutput [key] [value]"
//// Raw text:
"OnUser1" "!self,AddOutput,targetname new_name"
 
// Format of adding an Output: "AddOutput {targetname}:{inputname}:{parameter}:{delay}:{max times to fire, -1 means infinite}"
//// Raw text:
"OnUser1" "!self,AddOutput,OnUser1:SetParent:!activator:0.0:-1"
// Arguments can be left blank, but the empty blank should still be contained.
//// Raw text:
"OnUser1" "!self,AddOutput,OnUser1:ClearParent::0.0:-1"
</syntaxhighlight>| Syntax<nowiki>:</nowiki>}}|param=string}}
{{I|ClearContext|Removes all contexts from this entity's list.}}
{{I|ClearParent|Removes this entity from the movement hierarchy, leaving it free to move independently.}}
{{I|FireUser1|to=FireUser4|Fires the respective<code>OnUser</code>outputs; see [[User Inputs and Outputs]].}}
{{I|[[Kill]]|Removes this entity and any entities parented to it from the world.}}
{{I|KillHierarchy|Functions the same as <code>Kill</code>, although this entity and any entities parented to it are killed on the same frame, being marginally faster than<code>Kill</code>input.}}
{{I|RemoveContext|Remove a context from this entity's list. The name should match the key of an existing context.|param=string}}
{{I|SetParent|Move with this entity. See [[Entity Hierarchy (parenting)]].|param=string}}
{{I|SetParentAttachment|Change this entity to attach to a specific [[attachment]] point on its parent. The entity will teleport so that the position of its root [[bone]] matches that of the attachment.  Entities must be parented before being sent this input.|param=string}}
{{I|SetParentAttachmentMaintainOffset|As above, but without teleporting. The entity retains its position relative to the attachment at the time of the input being received.|param=string}}
{{I|Use|Same as a player invoking [[+use]]; no effect in most cases.|nofgd=1}}
{{I|SetTeam|Changes this entity's team.|nofgd=1|param=integer}}
{{I|TeamNum|This input changes value for <code>TeamNum</code> property.|nofgd=1|param=integer}}
{{I|DispatchResponse|Dispatches a response to the entity. See [[Response]] and [[Concept]].|param=string|nofgd=1}}
{{I|DispatchEffect|Dispatches a special effect from the entity's origin; See also [[List of Client Effects]]. Replaced by the [[particle]] system since {{l4d}}.|param=string|removed={{l4d}}|nofgd=1}}
{{I|RunScriptFile|Execute a [[VScript]] file from disk, without file extension. The script contents are merged with the script scope of the receiving entity.|param=script|since={{l4d2}}|also={{tf2}}}}
{{I|RunScriptCode|Execute a string of VScript source code in the scope of the entity receiving the input. String quotation may be needed when fired via console.|param=string|since={{l4d2}}|also={{tf2}}}}
{{I|CallScriptFunction|Calls a VScript function defined in the scope of the receiving entity.|param=string|since={{l4d2}}|also={{tf2}}|nofgd=1}}
{{I|TerminateScriptScope|Destroys the script scope of the receiving entity.|only={{tf2}}|nofgd=1}}
{{I|SetLocalOrigin|Send this entity to a spot in the map. If the entity is parented to something, it will be offset from the parent by this amount.|param=coordinates|since={{as}}|nofgd=1}}
{{I|SetLocalAngles|Set this entity's angles.|param=angles|since={{as}}|nofgd=1}}
 
== Outputs ==
{{O|OnUser1|to=OnUser4|These outputs each fire in response to the firing of the like-numbered FireUser1 to FireUser4 Input; see [[User Inputs and Outputs]].}}
OnKilled|only={{l4d}}|This output fires when the entity is killed and removed from the game.}}

Latest revision as of 06:59, 20 May 2025