12-Jul-2023
A, by default, toggleable entity, which, while activated, will compare any value of any entity's key with either a specified value or the keyvalue of another entity, using a specified comparator and fire its target for the according result- true or false- whenever the result of the condition changes (by default) or at the instant the trigger_condition entity is activated manually. While activated, the trigger_condition checks its condition every 0.1 seconds, by default. 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_condition so other entities can trigger it to start monitoring keyvalue (or compare once when "Cyclic" flag is checked). With "Cyclic" flag disabled the behaviour is based on trigger use-type: 'On'- turn comparator on, 'Off'- turn comparator off, 'Toggle'- toggle comparator. With "Cyclic" flag enabled only "On" and "Toggle" trigger use-types are accepted to compare once. Can be kill-targeted.
Monitored entity target : Name of the entity of which a keyvalue is to be monitored. The target entity may be removed in the process. Only one entity by this name should exist.
Monitored key m_iszValueName : Name of the key which value is to be compared to the value of the compare-key.
Compare-entity m_iszSourceName : Name of the entity of which a keyvalue shall serve as a compare-value. Only one entity by this name should exist.
Compare-key m_iszSourceKey : Name of the key which value is to be compared to the monitored key.
Compare-value (alternative) m_iszCheckValue : If you do not want to compare the monitored keyvalue to the keyvalue of another entity, you can directly specify a value here. Leave "Compare-entity" empty in that case.
Comparator; mon. val. -> comp.-val. m_iCheckType : Set the comparison type between monitored keyvalue and the other compare value.
Target for 'true'-case netname : Target to trigger in case the condition is true. Trigger use-type is 'Toggle'.
Target for 'false'-case message : Target to trigger in case the condition is false. Trigger use-type is 'Toggle'.
Constant mode trigger behaviour m_iCheckBehaviour : If the trigger_condition uses constant/non-cyclic/toggle-mode, this specifies how it will fire its true- and false- target.
Check-interval (seconds) m_fCheckInterval : If the trigger_condition is toggleable/constant, this specifies the delay between check-intervals, in seconds. Set to 0.0 to check every server-frame. Default is 0.1 seconds.
1 : Start Off : The trigger_condition starts off and has to be triggered on manually in order to work. This is automatically the case when "Cyclic" flag is selected.
2 : Don't use X (R) : When using vectors/arrays, this will ignore the first array.
4 : Don't use Y (G) : When using vectors/arrays, this will ignore the second array.
8 : Don't use Z (B) : When using vectors/arrays, this will ignore the third array.
16 : Don't use W (A) : When using vectors/arrays, this will ignore the fourth array.
32 : Cyclic; no toggle : Changes the trigger_condition's behaviour to a single-fire-behaviour. With this flag set, the entity will fire a target according to its condition's result once, and then idle until triggered again.
64 : Keep '!activator' : Because of trigger_condition's default behavior, the reference to the original activator is overwritten with the trigger_condition itself, because of an expected delay between activating the trigger_condition and a change in its condition's result; within this delay the original activator could have been removed already and thus cause unwanted behaviour when used. Because of that, you have to explicitly enable this flag for the activator to be forwarded normally. This is only dangerous to use if an entity triggered by trigger_condition will expect the activator to refer to a valid entity.
128 : Ignore initial result : If this is set and "Cyclic" flag is not selected, every time you activate it, the very first result it produces will be ignored and nothing will be triggered, and it will proceed normal according to the specified trigger-behaviour.
Trigger_condition supports the use of "!activator" and "!caller" in the "Monitored entity"- and "Compare-entity"-fields.
The type of comparison can depend on the types of the monitored keyvalue and comparison keyvalue. E.g. comparing a string "0 0 0" from monitored keyvalue to a vector { 0.0 0.0 0.0 } will cause the vector to be transformed into the string "0.000000 0.000000 0.000000". The string "0 0 0" is not equal to the string "0.000000 0.000000 0.000000". However, comparing a vector { 0.0 0.0 0.0 } from monitored keyvalue to a string "0 0 0" will cause the string to be parsed into another vector { 0.0 0.0 0.0 } which then is equal to the vector in the monitored keyvalue.
Comparing a vector to an integer or float will cause the length of that vector to be compared. (This works either way round) This happens in regards to the vector-dimension-exclusion keyvalues. Exception: If you exclude exactly two of the three vector-dimensions, you will get the extents of the vector in the one non-excluded dimension. That means if that extent is negative, you will also get it as negative.
Comparing vectors with each other will cause their lengths to be compared, unless comparison-type is "Equal" or "Unequal". Should that not be what you want, you'd have to parse the single extents into floats and compare them one by one for the time being.