Triggers/Conditions

From SC2Mapster Wiki
Jump to: navigation, search

If you want to create an action or function page, use this Template. If you want to create a new trigger category page, use this Template.

Trigger Elements

Ui-editoricon-general triggers.png Trigger Editor Overview Ui-editoricon-triggereditor newevent.png Events
Ui-editoricon-triggereditor newcondition.png Conditions Question.png Functions
Ui-editoricon-triggereditor newvariable.png Variables And Records Ui-editoricon-triggereditor newvariable.png Data Types
Ui-editoricon-triggereditor newpresettype.png Presets/Constants Ui-editoricon-triggereditor newaction.png Actions

Conditions

Conditions are evaluated to determine if a trigger should be run, like an if statement. All native conditions in Starcraft 2 belong to the Logic category. You can define new conditions with Condition Definitions, which must return true or false (Boolean return type). A trigger will only run if every condition is valid.

Condition Index

And

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.

Comparison

Evaluates and compares two Parameters of the same Type.

Not

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.

Or

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).

Text Has Been Set

Returns true if the Text Type Parameter is not null.

Within Bounds

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. All the parameters accept any numeric value.