11. Trigger & Tag Tutorial (Advanced)
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 FinalAlert 2: Yuri's Revenge TM 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.
Step 1: Create A New Variable
Trigger: Set up a local lose variable after Tanya is killed
Create a new variable called "Tanya lost" using Edit->Local Variables
Step 2: Create The Trigger
Create a trigger with the following attributes:
a. Name: "Tanya Killed"
b. Event: "48 Attached object destroyed"
c. Action: "56 Set local" parameter is the variable you created
Step 3: Adjust Tanya’s Attributes
Place Tanya on the map under the human player's control. Double-click on Tanya to bring up her unit attributes. Now change the "Attached Tag" property to "01000001 Tanya Killed 1".
Simple, isn't it? 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".
Original tutorial writer: Thalassicus