SC2Mapster Wiki
Advertisement

Data Types

About Types

Complex Types and Automatic Deletion

A number of types represent "complex" objects (i.e. objects larger than 4 bytes). Starcraft 2 automatically keeps track of these objects and deletes them from memory when they are no longer referenced by the script. Other types require that they be explicitly destroyed with the appropriate native function when no longer needed.

Types Affected by Automatic Deletion:

  • Ability Command
  • Bank
  • Camera Info
  • Color
  • Marker
  • Order
  • Player Group
  • Point
  • Region
  • Sound Link
  • String
  • Text
  • Timer
  • Transmission Source
  • Unit Filter
  • Unit Group
  • Unit References
  • Wave Info
  • Wave Target

Complex Types and Equality

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 including:

  • Ability Command
  • Color
  • Point
  • String
  • Unit Filter
  • Unit References

Examples:

True:
  • Point (1, 2) == Point (1, 2)
  • "String" == "String"
False:
  • Order(abilCmd) == Order(abilCmd)
  • RegionEmpty() == RegionEmpty()

Complex Types and + or - Operators

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

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


Primitive Types

  • Bool
  • Byte
  • Char
  • Fixed
  • Integer
  • Real

Game Types

  • Ability Command
  • Actor
  • Actor Message
  • Actor Scope
  • AI Filter
  • Animation Name
  • Attribute ID (Game)
  • Attribute ID (Player)
  • Attribute Value
  • Bank
  • Battle Report
  • Camera Object
  • Cinematic
  • Color
  • Conversation
  • Conversation Reply
  • Conversation State Index
  • Dialog
  • Dialog Item
  • Difficulty Level
  • Doodad
  • Game Link
  • Handle
  • Leaderboard
  • Marker
  • Mercenary
  • Model Camera
  • Objective
  • Order
  • Ping
  • Planet
  • Player Color
  • Player Group
  • Point
  • Portrait
  • Purchase Category
  • Purchase Group
  • Purchase Item
  • Region
  • Research Category
  • Research Item
  • Research Tier
  • Revealer
  • Room Button
  • Sound
  • Sound Link
  • String
  • Target Filter
  • Text
  • Text Tag
  • Time Of Day
  • Timer
  • Timer Window
  • Transmission
  • Transmission Source
  • Trigger
  • Unit
  • Unit Filter
  • Unit Group
  • Unit Type
  • Water
  • Wave
  • Wave Info
  • Wave Target
Advertisement