ttt_damageowner
ttt_damageowner
is a point entity available in Garry's Mod. This point entity is useful for correctly attributing damage to the player that activated a series of events. Traitor traps are an example of this. If a player activates a traitor trap with this entity set up correctly, then the !activator of the trap will be credited with the kill in the post-round logs. It is worth noting that karma will be correctly adjusted for any damage attributed to this entity. Whatever trigger is used to activate a trap, it is important that it also fires the output to the ttt_damageowner with the input of SetActivatorAsDamageOwner. This means that anybody who takes damage from the target entity will now be taking damage from the !activator.
Keyvalues
- Target Entity
(???)
<string> - The name of the entity that will have its damage owner and round report name specified. You want to set this to whatever entity is dealing the damage.
- Target entity's name in round report
(???)
<string> - Name of the target entity in the Round Report event log, ie. 'Bob was killed by Joe using <name>'. Should be short, like 'the gas trap' or 'a boulder'. This name takes effect the first time the SetActivatorAsDamageOwner input is fired.
Base:
- Parent
(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. (
parentname [targetname],[attachment]
)Tip:Entities transition to the next map with their parentsTip:phys_constraint
can be used as a workaround if parenting fails.
- Origin (X Y Z)
(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.
- Pitch Yaw Roll (X Y Z)
(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.
- Classname
(classname)
<string> !FGD - 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!
- Spawnflags
(spawnflags)
<flags> !FGD - Toggles exclusive features of an entity, its specific number is determined by the combination of flags added.
- Effects
(effects)
<flags> !FGD - Combination of effect flags to use.
- Entity Scripts
(vscripts)
<scriptlist> (in all games since ) (also in ) - 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.
- Think function
(thinkfunction)
<string> (in all games since ) (also in ) - 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.
- Lag Compensation
(LagCompensate)
<boolean> (in all games since ) !FGD - Set to Yes to lag compensate this entity. Should be used very sparingly!
- Is Automatic-Aim Target
(is_autoaim_target)
<boolean> (in all games since ) !FGD - If set to 1, this entity will slow down aiming movement for consoles and joystick controllers when the entity is under the crosshairs.
Inputs
SetActivatorAsDamageOwner
- The !activator of this input will be set as the damage owner for our target entity, meaning the damage the entity deals is attributed to that player (for points, karma, round report).
ClearDamageOwner
- Clears out the damage owner for the target entity.