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[edit source]

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

Data Types[edit | edit source]

About Types[edit | edit source]

Types are used by Variables, Functions, Presets and User Types for the game engine to store and reference specific kinds of data. In other words, integer variables can only store integers, and unit variables can only store units. The Parameters of Definitions require specific types to be defined to operate and Functions will only return values for specific parameter types. Some Conversion functions for the conversion of data between types do exist but the conversion of some types is less straight forward eg. the Point type.

Complex Types and Automatic Deletion[edit | edit source]

A number of types represent "complex" objects (i.e. objects larger than 4 bytes). These objects are larger than the maximum variable size (4 bytes) so have to be stored externally with a reference used to locate them. StarCraft II automatically keeps track of these objects and deletes them from memory when they are no longer referenced by the Galaxy virtual machine. Other types require that they be explicitly destroyed with the appropriate native function when no longer needed.

Types Affected by Automatic Deletion:[edit | edit source]

Complex Types and Equality[edit | edit source]

Comparing two "complex" objects with the == or != operators will only compare the object reference, not the contained object data in most cases. However, a few types will compare the contained data instead.

These types are:


//      Point(1, 2) == Point(1, 2)                              // True
//      "test string" == "test string"                          // True (note: this is case sensitive)
//      AbilityCommand("move", 0) == AbilityCommand("move", 0)  // True
//      Order(abilCmd) == Order(abilCmd)                        // False (two different order instances)
//      RegionEmpty() == RegionEmpty()                          // False (two different region instances)

Complex Types and + or - Operators[edit | edit source]

Other than numerical types (byte, int, fixed) the operators that support + and/or - operators are:

  • Point (+ or - Adds or Subtracts the X and Y values of the Points)
  • String (+ Concatenates the two Strings)
  • Text (+ Concatenates the two Texts)

Primitive Types[edit | edit source]

Game Types[edit | edit source]

Other[edit | edit source]