trigger_condition

A trigger_condition compares a key of an entity with a value, or with a key of another entity, and fires its "true"
or its "false" target. With Cyclic, it checks once for each trigger, and without it, it keeps checking while it is
on, so it can watch a key such as a monster's health or the position of a train. See the Changing
values guide for a setup with it.
Attributes
The entity also has these common keys:
- Naming and triggering: Name
targetNames the entity whose key it checks, as a name, !activator or !caller.
m_iszValueNameNames the key it checks.
m_iszSourceNameNames an entity to compare with. If you set it and Compare-key, the entity ignores Compare-value.
m_iszSourceKeyNames the key of the Compare-entity.
m_iszCheckValueSets the value to compare with when there is no Compare-entity.
If you leave this key empty, it is 0.
m_iCheckTypeSets how the entity compares the monitored value with the compare value. & only works on keys that hold whole numbers.
- == (Equal) (0)
- != (Not equal) (1)
- < (Less) (2)
-
(Greater) (3)
- <= (Less or equal) (4)
-
= (Greater or equal) (5)
- & (any bit set, integer keys) (6)
== (Equal) (0)netnameFires this target when the comparison is true.
messageFires this target when the comparison is false.
m_iCheckBehaviourWhile the entity is on, sets when the targets fire. "Result has changed" only fires when the result differs from the last check.
- Result has changed (0)
- Result has changed or it keeps being true (1)
- Result has changed or it keeps being false (2)
- Always (3)
- When the entity turns on, the last result counts as true. So with "Result has changed", a first result of true fires nothing
Result has changed (0)m_fCheckIntervalWhile it is on, sets how many seconds pass between two checks, at least 0.01.
0.1round_resetWith Yes, the entity goes back to the way it was when the map loaded, at each round start before the players spawn. See Round hooks for more details.
- No (0)
- Yes (1)
No (0)Flags
1Start OffThe entity starts off, and a trigger turns it on
2Don't use XThe X of a vector isn't compared
4Don't use YThe Y of a vector isn't compared
8Don't use ZThe Z of a vector isn't compared
32CyclicEach trigger checks once, and the entity has no on and off state
64Keep activatorThe targets get the activator of the trigger. Without this flag, the trigger_condition itself is the activator
128Ignore initial resultThe first check after it turns on fires nothing
Notes
- Without Start Off or Cyclic, it is on from the start and checks every Check interval
- A trigger with On turns it on, a trigger with Off turns it off, and a trigger with Toggle switches it
- A target that triggers the same
trigger_conditionwhile it fires is ignored - For vectors, "Equal" and "Not equal" compare all three numbers when the compare value is a vector. The other comparisons use the vector's length
- Without a Monitored entity or a Monitored key, the entity removes itself. With
developer 1set in the console, the console says so - Setups from Sven Co-op carry over, because the class name, key names, flags and comparison numbers are the same
See also
trigger_compare- compares two numberstrigger_changevalue- changes a key- Changing values - a guide with small setups
Changes since 1.38
trigger_conditionis new

