Triggers
Active vs InactiveTriggers are "active" by default, meaning they will fire whenever their condition is met. They can be set to Inactive manually in the script. Triggers set themselves to Inactive when they fire. This means that if you want something to be repeatable, you need to reactivate it somewhere in the script.
Repeating TriggersUsing <ActivateTrigger="triggername"/> to tell a trigger to activate itself will make it repeatable (if you want something to happen every time the player builds a Dreadnought, for example, or waves of enemies to spawn and attack every 15 seconds).
Conditional TriggersUsing the OtherTrigger and NotOtherTrigger arguments is a way to gate your scenario's logic. For purposes of those arguments, a trigger 'counts' if it has been activated at least once during the game. However, you can't stack multiple Conditional Triggers. To word it another way, OtherTrigger="Triggername" means only run the Trigger if this Trigger has happened, while NotOtherTrigger means only run the Trigger if this other Trigger hasn't happened. There is currently no way to "un-activate" a trigger, as far as OtherTrigger and NotOtherTrigger are concerned. Here's what that may look like: <Trigger Name="tNE_Spawn1" Type="Var" Var="vNE_Spawn" Operator="==" Value="1" NotOtherTrigger="tNE_SpawnSuppress" > <SpawnUnit Name="uNE_Leader1" Template="PHC_2_Zeus" Player="5" Position="-9344,-8064" /><Trigger Name="tNE_Spawn1" Type="Var" Var="vNE_Spawn" Operator="==" Value="1" NotOtherTrigger="tNE_SpawnSuppress" > <SpawnUnit Name="uNE_Leader1" Template="PHC_2_Zeus" Player="5" Position="-9344,-8064" /> <Trigger> In this case, the NotOtherTrigger means do not run the unit spawn trigger if the SpawnSuppression Trigger has been activated, (a certain region has been captured.) Another example is NotOtherTrigger="Difficulty4" means don't run the trigger if the player is playing on Expert.
Common Trigger ArgumentsAll triggers share some attributes in common:
Trigger TypesThese are the types of triggers you can use in a script, and any specific arguments they support.
AreaThe area trigger fires when the human player moves a unit into the area.
BuildThe build trigger fires when a human player builds structures or units.
DestructionThe destruction trigger fires when something specific dies.
DifficultyThe difficulty trigger fires at the beginning of a scenario if the given difficulty was chosen
NamedCreateThe NamedCreate trigger fires when a specific unit or building is spawned via a script.
ResearchThe research trigger fires when a player researches a Quantum Upgrade
TimerThe timer trigger fires after a delay.
VarThe var trigger fires if a variable meets given criteria
This is useful if you want to make capturing 4 regions or killing 4 AI players do something, but only when all of them have been done at the same time. However, you have to be careful in the case of capturing all 4 regions that it doesn't get messed up by if the AI captures the region back. This is where conditional triggers are essential.
ZoneCaptureThe ZoneCapture trigger fires when a region is captured.
|