Difference between revisions of "Conditions"

From HIVE
Jump to navigation Jump to search
(Created page with "=== How to use Conditions to filter Events === Wondering how to do things more specific than simply "Any unit enters 'region'"? You'll have to use Conditions. For example, if...")
 
 
Line 1: Line 1:
=== How to use Conditions to filter Events ===
+
Conditions are used to specify certain aspects of a [[trigger]]'s [[Events|events]]. By using Conditions, you can make your trigger react differently despite using a very general Event to start it.
Wondering how to do things more specific than simply "Any unit enters 'region'"? You'll have to use Conditions.
 
  
For example, if you want to know when any Marine of the Player 2 enters the region named 'NO U', here's what you'll have to do:
+
==Comparison==
{{Trigger
+
The '''Comparison''' Condition evaluates and compares two arguments.
|events=Any unit enters 'NO U'
 
|conditions=Triggering Unit Type == Marine
 
  
Triggering Player == 2
+
==And==
}}
+
The '''"And"''' Condition returns true if all of the conditions listed under the "And" condition return true.  By default, lists of conditions without an "And" condition or an "Or" condition must all return true in order for the condition to evaluate to true (they are treated as if they were under an "And" condition).  Therefore, this condition is only necessary if it is nested within another condition such as a "Not" condition or an "Or" condition.
 +
 
 +
==Or==
 +
The '''"Or"''' Condition returns true if any of the conditions listed under the "Or" condition return true.  By default, lists of conditions without an "And" condition or an "Or" condition must all return true in order for the condition to evaluate to true (they are treated as if they were under an "And" condition).
 +
 
 +
==Not==
 +
The '''"Not"''' Condition returns true if all the conditions listed under it evaluate to false.  If multiple conditions are listed under the "Not" condition, those conditions will first be evaluated as if they were under an "Or" condition, and then the "Not" condition will invert the result.
 +
 
 +
==Text Has Been Set==
 +
The '''"Text Has Been Set"''' Condition returns true if the Text parameter is not null.
 +
 
 +
==Within Bounds==
 +
The '''"Within Bounds"''' Condition returns true if the Value parameter is in between the Min and Max parameters, or if the Value parameter is equal to either the Min or the Max parameter.
  
 
[[Category:StarCraft II]]
 
[[Category:StarCraft II]]
 
[[Category:Triggers]]
 
[[Category:Triggers]]
 
[[Category:Reference]]
 
[[Category:Reference]]

Latest revision as of 22:16, 28 March 2013

Conditions are used to specify certain aspects of a trigger's events. By using Conditions, you can make your trigger react differently despite using a very general Event to start it.

Comparison

The Comparison Condition evaluates and compares two arguments.

And

The "And" Condition returns true if all of the conditions listed under the "And" condition return true. By default, lists of conditions without an "And" condition or an "Or" condition must all return true in order for the condition to evaluate to true (they are treated as if they were under an "And" condition). Therefore, this condition is only necessary if it is nested within another condition such as a "Not" condition or an "Or" condition.

Or

The "Or" Condition returns true if any of the conditions listed under the "Or" condition return true. By default, lists of conditions without an "And" condition or an "Or" condition must all return true in order for the condition to evaluate to true (they are treated as if they were under an "And" condition).

Not

The "Not" Condition returns true if all the conditions listed under it evaluate to false. If multiple conditions are listed under the "Not" condition, those conditions will first be evaluated as if they were under an "Or" condition, and then the "Not" condition will invert the result.

Text Has Been Set

The "Text Has Been Set" Condition returns true if the Text parameter is not null.

Within Bounds

The "Within Bounds" Condition returns true if the Value parameter is in between the Min and Max parameters, or if the Value parameter is equal to either the Min or the Max parameter.