User:Pinsplash/BaseEntity: Difference between revisions

From Valve Developer Community
Jump to navigation Jump to search
(Created page with "Basic functions for all entities: {{ExpandBox| <code> @BaseClass {{=}} CBaseEntity [ {{User:Pinsplash/FGDline|smart=Name|targetname|param=target_source|The name that other e...")
 
(oop)
Line 14: Line 14:
{{User:Pinsplash/FGDline|smart=Origin (X Y Z)|param=origin|coordinates|The position of this entity's center in the world. Rotating entities typically rotate around their origin.}}
{{User:Pinsplash/FGDline|smart=Origin (X Y Z)|param=origin|coordinates|The position of this entity's center in the world. Rotating entities typically rotate around their origin.}}


{{User:Pinsplash/FGDline|smart=Pitch Yaw Roll (X Y Z)|param=angles|angle|def="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. This works on brush entities, although Hammer doesn't show the new angles.}}
{{User:Pinsplash/FGDline|smart=Pitch Yaw Roll (X Y Z)|angles|param=angle|def="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. This works on brush entities, although Hammer doesn't show the new angles.}}


{{User:Pinsplash/FGDline|smart=Flags|spawnflags|param=integer|The Flags tab as the true number it is. 99% of the time you don't need to touch it here.}}
{{User:Pinsplash/FGDline|smart=Flags|spawnflags|param=integer|The Flags tab as the true number it is. 99% of the time you don't need to touch it here.}}

Revision as of 10:25, 15 September 2018

Basic functions for all entities:


@BaseClass = CBaseEntity

[

targetname(target_source) : "Name" :  : "The name that other entities refer to this entity by."

globalname(string) : "Global Entity Name" : "" : "Name by which this entity is linked to another entity in a different map. When the player transitions to a new map, entities in the new map with globalnames matching entities in the previous map will have the previous map's state copied over their state."

parentname(target_destination) : "Parent" :  : "Specifies a movement parent. An entity will maintain its initial offset from its parent. An attachment point can be added to the end of the name, separated by a comma. Every entity can be parented, even point entities. Entities which are parented will be forced to transition to the next map, such as from a trigger_transition. Some entities which aren't intended to be parented may not function correctly. phys_constraint can be used as a workaround to parenting."

coordinates(origin) : "Origin (X Y Z)" :  : "The position of this entity's center in the world. Rotating entities typically rotate around their origin."

angles(angle) : "Pitch Yaw Roll (X Y Z)" : "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. This works on brush entities, although Hammer doesn't show the new angles."

spawnflags(integer) : "Flags" :  : "The Flags tab as the true number it is. 99% of the time you don't need to touch it here."

ResponseContext(string) : "Response Contexts" :  : "Pre-defined response system contexts for this entity. Format is key:value,key:value,..."

effects(integer) : "Effects" :  : "Combination of effect flags to use."

ltime(float) : "Local Time" :  : "The local time of the entity, independent of the global clock. Used mainly for physics calculations."

nextthink(float) : "Next Think" :  : "Amount of time before the entity thinks again."

hammerid(integer) : "Hammer ID" :  : "The entity's Hammer ID. Mainly used by plugins and debugging commands, such as ent_keyvalue. Can be manually assigned. Entities spawned at run-time are not assigned any Hammer ID."

mincpulevel(integer) : "Minimum CPU Level (Since L4D)" :  : "Minimum CPU Level allowed for this entity. 0 means all levels allowed."

maxcpulevel(integer) : "Maximum CPU Level (Since L4D)" :  : "Maximum CPU Level allowed for this entity. 0 means all levels allowed."

mingpulevel(integer) : "Minimum GPU Level (Since L4D)" :  : "Minimum GPU Level allowed for this entity. 0 means all levels allowed."

maxgpulevel(integer) : "Maximum GPU Level (Since L4D)" :  : "Maximum GPU Level allowed for this entity. 0 means all levels allowed."

vscripts(scriptlist) : "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."

thinkfunction(string) : "Script think function (Since L4D2)" :  : "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."

LagCompensate(choices) : "Lag Compensation (Since L4D2)" : 0 : "Set to Yes to lag compensate this entity. Should be used very sparingly!" =

[

0: "No"

1: "Yes"

]

is_autoaim_target(choices) : "Is Automatic-Aim Target (Since CSGO)" :  : "If yes, automatic-aim assistance will target this entity." =

[

0: "No"

1: "Yes"

]

///////////////////////inputs

input Kill(void) : "Removes this entity and any entities parented to it from the world."

input KillHierarchy(void) : "Functions the same as Kill, although this entity and any entities parented to it are killed on the same frame."

input SetParent(string) : "Move with this entity."

input SetParentAttachment(string) : "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."

input SetParentAttachmentMaintainOffset(string) : "Same as SetParentAttachment, but without teleporting. The entity retains its position relative to the attachment at the time of the input being received."

input ClearParent(void) : "Removes this entity from the the movement hierarchy, leaving it free to move independently."

input AddOutput(string) : "Evaluates a keyvalue or output on this entity. KEYVALUES: <key> <value> OUTPUTS: <output name> <targetname>:<inputname>:<parameter>:<delay>:<max times to fire, -1 means infinite>"

input FireUser1(void) : "Fire OnUser1."

input FireUser2(void) : "Fire OnUser2."

input FireUser3(void) : "Fire OnUser3."

input FireUser4(void) : "Fire OnUser4."

input Use(void) : "Same as a player invoking +use; may not do anything. Can also be invoked by creating an output that does not specify an input."

input DispatchEffect(string) : "Dispatches a special effect from the entity's origin. Replaced by particles since Left 4 Dead."

input DispatchResponse(string) : "Dispatches a response to the entity."

input AddContext(string) : "Adds to the entity's list of response contexts. Format is <key>:<value>."

input RemoveContext(string) : "Remove a context from this entity's list. The name should match the key of an existing context."

input ClearContext(string) : "Removes all contexts from this entity's list."

input RunScriptFile(script) : "Since L4D2. Execute a VScript file from disk, without file extension. The script contents are merged with the script scope of the receiving entity."

input RunScriptCode(string) : "Since L4D2. 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. In l4d2, the code is executed in the script scope of the entity that fires the output, not the one receiving the input. Never try to pass string parameters to a script function with this input. It will corrupt the VMF structure because of the nested quotation marks, which then must be removed manually with a text editor."

input CallScriptFunction(string) : "Since L4D2. Execute a VScript function in the scope of the receiving entity."

input SetLocalOrigin(origin) : "Since p2. Set this entity's origin in the map. (dubious)"

input SetLocalAngles(angles) : "Since p2. Set this entity's angles in the map. (dubious)"

////////////////////////outputs

output OnUser1(void) : "Fires in response to the firing of FireUser1."

output OnUser2(void) : "Fires in response to the firing of FireUser2."

output OnUser3(void) : "Fires in response to the firing of FireUser3."

output OnUser4(void) : "Fires in response to the firing of FireUser4."

output OnKilled(void) : "Left 4 Dead only. This output fires when the entity is killed and removed from the game."

]