Triggers/Definitions

From SC2Mapster Wiki
Jump to: navigation, search

Definitions

Definitions enable map makers to make their own Actions, Conditions, Events and Functions. Unlike Native definitions which interface directly with the SC2 game engine, map maker made definitions usually use a series of definitions from the Built-In trigger library to simplify complex but repetitive tasks like dialog item creation or attack wave logistics. Custom "Action Definitions" also have the advantage of being able to create new threads enabling parallel execution bypassing delays caused by what would otherwise be a series of wait actions.

Fields Description

Options

Type

What trigger sub-element this definition will be used for.

  • Action: The definition will appear as an Action in the GUI
  • Condition: The definition will appear as a Condition in the GUI
  • Event: The definition will appear as an Event in the GUI
  • Function: The definition will appear as a Function in the GUI

Options

  • Create Thread: Creates a new thread when this definition is executed enabling parallel execution of actions.
    • Using Action Definitions with this flag enabled is a must if using For Each Integer actions that have a Wait action nested under them to prevent delays.
    • More information about Multithreading.
  • Custom AI: (Unknown)
  • Custom Script: Flag that enables use of any custom Galaxy script used in the Custom Script Code field. Available options are game engine restricted.
  • Hidden: Prevents this definition appearing in the GUI windows. Only use if this definition is extremely specialised or the GUI is becoming cluttered with low use custom definitions.
  • Inline: (Unknown)
  • Loop: The Sub-Functions under this definition will repeat in a loop unless a Break action is used
  • Native: Usually only used by the natives from the Built-In trigger library to flag that they use script directly linked to the SC2 game engine
  • No Script Prefix: (Unknown)
  • Operator: Used for Function type definitions to indicate a processing of stored information of a Type without giving a specific answer.
  • Restricted: Official Blizzard map only flag
  • Sub-Functions: Enables Action and Condition functions to have additional definitions nested under them (like Logic conditions and Loop actions

Event Response For

  • What Native events trigger this definition if it is an Event Definition.

Return Type

The defined value of a specific Type returned by this definition if a Condition or Function definition

  • Condition definitions must return a Boolean type
  • The Return Type restricts what Function definitions appear as options available to define parameters of specific types belonging to other definitions (an Actor return type can only be used to define an Actor parameter).
  • Share the same fields as Variables

Parameters

What values of specific Types need to be defined to use this definition within another definition or trigger.

  • Used to define the parameters of definitions within this definition in the same way as a variable is able to be used.
  • Share the same fields as Variables

Grammar text

  • String seen in the middle of the lower right window of the GUI when using this definition
  • Usually automatically generated

Hint Text

Text seen in the GUI window when browsing definitions to add a new sub-element or for functions to define a Parameter of an existing sub-element.

Custom Script Code

  • Galaxy scripting language used by this definition
  • Requires the Custom Script: flag

Local Variables

Actions

  • The Action Definitions performed by this definition
  • Used to derive the defined Parameter values to return for Function Definitions
  • Contain the If Then Else action definitions to return for Condition Definitions
  • Have the list of actions that an Action Definition will perform
Promotional Content