12-Jul-2023
Trigger_changevalue can perform arithmetic and logic operations on base-keyvalues of entities, as well as replace their private keyvalues. See trigger_copyvalue for a variant of this with more options. Supports custom keyvalues.
Keyvalues |
OnDestroy Function ondestroyfn : Name of the function to use from already parsed .as script files when entity is destroyed (killed) in any way. If the function belongs to namespace, you must use prefix with the namespace name (e.g. mynamespace::MyFunction) for the keyvalue.
Name targetname : Set name of trigger_changevalue so other entities can trigger it to apply value change. Every trigger use-type works uniformly. Can be kill-targeted.
Destination entity target : Name of the entity which keyvalue is to change. This can refer to more than one.
Destination key m_iszValueName : Name of the key which's value is to be changed.
Source value m_iszNewValue : Value to be applied to the destination keyvalue.
Action m_iszValueType : This specifies how destination keyvalue and static source-value correlate. What exactly happens also depends on the types of the two.
Trigonometric funcs. I/O m_trigonometricBehaviour : When using trigonometric or arc-functions as per the "Operation"-keyvalue, this is used to determine what your input/desired output measure is. You'll usually want to stick to degrees.
Append spaces (for strings) m_iAppendSpaces : When the destination keyvalue is a string, this specifies how many spaces to append after the operations. You'll usually want to use this with either the "Replace"- or "Append"-operation. This was implemented because Valve Hammer Editor omits any trailing spaces in keyvalues (but not leading ones).
Trigger after action message : Entity to trigger after the trigger_changevalue has set the new keyvalue, by targetname as usual. This is very useful when you need a chain of operations to happen in a specific order and without any delay in between. Trigger use-type is 'Toggle'.
1 : Don't use X : When using vectors/arrays, this will ignore the first array. E.g., when setting render-color, specifying this flag would ignore the 'Red'-value.
2 : Don't use Y : When using vectors/arrays, this will ignore the second array. E.g., when setting angles, specifying this flag would ignore the 'Yaw'-value.
4 : Don't use Z : When using vectors/arrays, this will ignore the third array. E.g., when setting velocity, specifying this flag would ignore the vertical velocity.
32 : Invert target value : The destination keyvalue will be multiplied with minus one before proceeding.
64 : Invert source value : The source-value will be multiplied with minus one before proceeding; this change is only temporary and this keyvalue is rather useless, as you can always prepend a minus-sign to the static source-value.
Trigger_changevalue supports the use of "!activator" and "!caller" in the "Destination Entity"-field.
Trying to write a vector to a float or integer will cause the vector's length to be written. This is in respect to any ignored dimensions as per spawnflags.