Trigger & Tag tutorial 5 (advanced)
Written by: Thalassicus
Modified by Matze
Creating & Using Triggers and Tags
In addition to events and actions, triggers also have a structure called a tag associated with them. Tags are identifiers for the triggers; they tag them for use. The trigger editor with Final Alert automatically sets up and handles tags for you, but it is important to understand their purpose to accomplish many tasks. One common such task is a trigger that will fire when an important unit is destroyed, such as Tanya.
To set a global lose variable after Tanya is killed:
1) Create a new variable called "Tanya lost" using Edit->Global variables
2) Create a trigger with the following attributes:
a. Name: "Tanya Killed"
b. Event: "48 Attached object destroyed"
c. Action: "56 Set global", parameter is the variable you created
3) Place Tanya on the map under the human player's control
4) Double-click on Tanya to bring up her unit attributes.
5) Change the "Attached Tag" property to "01000001 Tanya Killed 1"
Simple, isn't it? You can also edit tags and triggers separately using the outdated "Tags" and "Triggers" options under the Edit menu (Matze: Not recommended ;). Structures and vehicles can also be attached to a tag, in addition to any Teams you have created. This is how the player wins when the Kremlin is destroyed (same event "attached object destroyed") or after a paradropped Yuri is killed. Many actions also use tags, such as action 14, "Give attached objects to house".