Trigger Basics
   By SD_Ryoko Introduction to triggers
Triggers are an alternative method of controlling gameplay. Triggers are a simplified programming language with a graphical interface. They have been designed to be simple enough for novice users, yet they can control almost any aspect of gameplay.

Melee maps vs Trigger maps
Typically, melee maps use a standard set of triggers. These triggers are created in every new map by default. These default triggers set the time of day, starting resources, create starting units, and so forth. More triggers can be added to a melee map, but once they have been removed it is now classified as a 'trigger' map.

Trigger maps typically run off a custom set of triggers. These types of maps could include hero siege maps, tower defense maps, AoS maps and any other type of map that does not run off the default set of triggers. Remember that, once you do delete the default set of triggers, you will have to create your own method of gameplay. Player resources, starting units and items will no longer be created when the map starts.

Trigger basics
Before you create any trigger you must have a category to put them in. You may put them in the original Initialization category created by the editor, but you are not required to. Categories have no impact on the functionality of the trigger. A trigger is composed of three parts: events, conditions, and actions. When one of the events occurs, given all conditions are met, the actions will take place.

There are three fields at the top of each trigger:
  • Enabled - This determines whether or not the trigger is enabled in your map. If not enabled, the trigger has no function.
  • Initially On - Triggers can be turned on and off. When checked, the trigger will initially be on when the game starts.
  • Trigger Comment - This text field is an area for you to add any comments about the trigger. It has no impact on functionality.
Events
A trigger will fire when ANY of the events listed occur. Note that, you can run a trigger from another trigger without those events occuring. It is also improper to refere to things such as "triggering unit" or "Ability being cast" if you ran the trigger from inside another. Examples of events would be a unit entering a region, a unit dies, elapsed game time or a countdown timer expiring.

Conditions
Conditions are specific requirements that the trigger must follow. It cannot perform its actions unless ALL the conditions have been met. Take note that you can have 'and', 'or' and negative conditions as well. Triggers that are run from another trigger have the option to ignore these conditions.

Actions
Given an event occurs, and all conditions are met, these are the actions that the trigger will perform. Here you can set variabls, order units to perform actions, change the time of day, and just about anything else you need the trigger to perform. You may run other triggers or turn triggers off as well.

Example Trigger
Below is a sample trigger from a custom map. The trigger will fire whenever a hero dies, and it will revive it at the players starting location.

SD_Ryoko
 
 
WoW Gold Silkroad Online Forums
Team Griffonrawl Trains Muay Thai and MMA fighters in Ohio.
Dickinson by Design specializes in custom Diamond Engagement Rings in Gold and Platinum.
Barfield Photography is a Houston Wedding Photography studio.
Promotional Products Direct specializes in Engravable Corporate Gifts.
Able Auto Glass specializes in Houston Auto Glass Replacement as well as windshield repair and replacement services.
Apex Steel Pipe - Buys and sells Steel Pipe.
TIJC specializes in Wholesale Silver Charms.