Skip to main content

trigger_copyvalue

trigger_copyvalue icon
Point entityPorted from SevenKewpSven Co-op

A trigger_copyvalue copies a key of one entity into a key of other entities, once for each trigger or again and again while it is on. It can combine the copied value with the current one, as a trigger_changevalue does.

Attributes​

The entity also has these common keys:

KeyDescriptionDefault
Source entitynetname

Names the entity to read: the first entity with this name, or !activator or !caller.

Source keym_iszSrcValueName

Names the key to read.

Destination entitytarget

Names the entities to write: the first entity with this name, or every entity with this name with Multiple destinations, or !activator or !caller.

Destination keym_iszDstValueName

Names the key to write.

Float conversionm_iFloatConversion

Sets how the entity writes a number with decimals into a text key or a whole-number key: with a number of decimal places, or rounded.

The 9 choices
  • 6 decimal places (default) (0)
  • 5 decimal places (1)
  • 4 decimal places (4)
  • 3 decimal places (7)
  • 2 decimal places (10)
  • 1 decimal place (13)
  • Round to nearest whole number (16)
  • Round up (17)
  • Round down (18)
Default 6 decimal places (default) (0)
Copy intervaldmg

With Constant, sets how many seconds pass between two copies.

Default 0
Type of valuem_iszValueType

Sets the operation, as on a trigger_changevalue.

The 27 choices
  • Replace (= new value) (0)
  • Add (= old + new) (1)
  • Mul (= old * new) (2)
  • Sub (= old - new) (3)
  • Div (= old / new) (4)
  • Pow (= old ^ new) (16)
  • Mod (= old % new, whole numbers) (12)
  • AND (= old & new) (5)
  • OR (= old | new) (6)
  • XOR (= old ^ new) (13)
  • Clear bits (= old & ~new) (15)
  • Min (= min(old, new)) (30)
  • Max (= max(old, new)) (31)
  • NAND (bitwise: = ~(old & new)) (7)
  • NOR (bitwise: = ~(old | new)) (8)
  • NXOR (bitwise: = ~(old ^ new)) (14)
  • Direction to Angles (= angles of old) (9)
  • Angles to Direction (= direction of old) (10)
  • Append (String concatenation) (11)
  • Sin (= sin(new)) (17)
  • Cos (= cos(new)) (18)
  • Tan (= tan(new)) (19)
  • Cot (= cot(new)) (23)
  • Arcsin (= arcsin(new)) (20)
  • Arccos (= arccos(new)) (21)
  • Arctan (= arctan(new)) (22)
  • Arccot (= arccot(new)) (24)
Default Replace (= new value) (0)
Trigonometric funcs. behaviorm_trigonometricBehaviour

Sets the unit of the angle operations.

  • Degrees (0) - Sin, Cos, Tan and Cot take the value in degrees, and Arcsin, Arccos, Arctan and Arccot give degrees, so the sine of 30 is 0.5
  • Radians (1) - Both are in radians
Default Degrees (0)
Append spacesm_iAppendSpaces

For text, adds this many spaces after the result, up to 255.

Default 0
Trigger after operationmessage

Fires this target after each copy. It can be a name, !activator or !caller.

Flags​

1Don't use X

The X of a vector stays as it is

2Don't use Y

The Y of a vector stays as it is

4Don't use Z

The Z of a vector stays as it is

8Constant

A trigger turns the copying on or off. While the copying is on, the entity copies every Copy interval seconds

16Start on

With Constant, the copying is on from the start

32Invert target value

The current value becomes negative before the operation

64Invert source value

The copied value becomes negative before the operation

128Multiple destinations

The entity writes every entity named in Destination entity, not only the first

Notes​

  • Each trigger copies once. With Constant, a trigger with On also turns the copying on, Off turns it off and Toggle switches it
  • The entity writes nothing if a key names a model or a sound, or the destination key is classname or headscale. It also writes nothing if the source entity, the source key or the destination key is missing. With developer 1 set in the console, the console says so
  • Setups from Sven Co-op carry over, because the class names, key names, flags and operation numbers are the same

See also​

Changes since 1.38​

  • trigger_copyvalue is new