SC2Mapster.com Wiki

SC2 API / Functions / TriggerAddEventMapInit

TriggerAddEventMapInit

void TriggerAddEventMapInit (trigger t);

Register a trigger that will be executed on map initialization.

Parameters

trigger t

The trigger that will be executed. Must have the following prototype:

bool name(bool checkConds, bool doActions);
  • checkConds : always true?
  • doActions : always true?
  • The return value is used to increment either FailedConditions (when false) or Run in the debug trigger window

Examples

Example: Run script every X seconds
// Define the trigger function
bool TriggerTiming (bool checkConds, bool doActions) {
  while (1) {
    // Do something every 5 seconds
    Wait(5, 0);
  }
}

void InitMap () {
  // Create a new trigger based off the function
  trigger t = TriggerCreate("TriggerTiming");

  // Run it at map initialization
  TriggerAddEventMapInit (t);
}

You must login to post a comment. Don't have an account? Register to get one!

Facts

Date created
10 Mar 2010
Last updated
10 Mar 2010

Author