Triggers: Difference between revisions

From Ashes of the Singularity - Official Wiki
Jump to navigation Jump to search
No edit summary
No edit summary
Line 1: Line 1:
'''Triggers''' are what control anything you want to happen while the scenario is being played, from spawning starting base to calling waves of attacking enemies or giving players objectives. There are several types of triggers which activate off of different events.


'''Triggers''' are what control anything you want to happen while the scenario is being played, from spawning starting base to calling waves of attacking enemies or giving players objectives. There are several types of triggers which activate off of different events, but they all share some attributes in common:
== Common Trigger Arguments ==
All triggers share some attributes in common:


*'''Name''' - Name of the trigger. Required.  
*'''Name''' - Name of the trigger. Required.  
Line 12: Line 14:
These are the types of triggers you can use in a script, and any specific arguments they support.
These are the types of triggers you can use in a script, and any specific arguments they support.


===[[Area_Trigger|Area]]===
=== [[Area_Trigger|Area]] ===
 
Fires when the human player moves a unit into the area.
Fires when the human player moves a unit into the area.


Line 19: Line 22:
*'''Template''' - Template name of the unit that can trigger this. If you want it to fire if any unit enters the area, do not specify a Template argument.  
*'''Template''' - Template name of the unit that can trigger this. If you want it to fire if any unit enters the area, do not specify a Template argument.  


===[[Build_Trigger|Build]]===
=== [[Build_Trigger|Build]] ===
 
Fires when a human player builds structures or units.
Fires when a human player builds structures or units.


Line 26: Line 30:
*'''Count''' - How many of the target template must be built to fire the trigger (default 1)  
*'''Count''' - How many of the target template must be built to fire the trigger (default 1)  


===[[Destruction_Trigger|Destruction]]===
=== [[Destruction_Trigger|Destruction]] ===
 
Fires when something specific dies.
Fires when something specific dies.


Line 32: Line 37:
*'''Target''' - Name of the script-spawned unit or building.  
*'''Target''' - Name of the script-spawned unit or building.  


===[[Difficulty_Trigger|Difficulty]]===
=== [[Difficulty_Trigger|Difficulty]] ===
 
Fires at the beginning of a scenario if the given difficulty was chosen
Fires at the beginning of a scenario if the given difficulty was chosen


*'''Difficulty''' - The given difficulty (0 for Much Easier, up to 4 for Much Harder)  
*'''Difficulty''' - The given difficulty (0 for Much Easier, up to 4 for Much Harder)  


=== [[NamedCreate_Trigger|NamedCreate]] ===


===[[NamedCreate_Trigger|NamedCreate]]===
Fires when a specific unit or building is spawned via a script.
Fires when a specific unit or building is spawned via a script.


Line 44: Line 50:
*'''IsBuilding''' - If this is a building (if not it refers to a unit).  
*'''IsBuilding''' - If this is a building (if not it refers to a unit).  


===[[Research_Trigger|Research]]===
=== [[Research_Trigger|Research]] ===
 
Fires when a player researches a Quantum Upgrade
Fires when a player researches a Quantum Upgrade


Line 50: Line 57:
*'''Target''' - The name of the tech  
*'''Target''' - The name of the tech  


===[[Timer_Trigger|Timer]]===
=== [[Timer_Trigger|Timer]] ===
 
Fires after a delay.
Fires after a delay.


*'''Time -''' Time in seconds after this gets triggered that it takes place.  
*'''Time -''' Time in seconds after this gets triggered that it takes place.  


===[[Var_Trigger|Var]]===
=== [[Var_Trigger|Var]] ===
 
Fires if a variable meets given criteria
Fires if a variable meets given criteria


Line 63: Line 72:
*''Example: <Trigger Name="tWeasleyDead" Type="Var" Var="vWeasleyDead" Operator="==" Value="1" > - this fires when the "vWeasleyDead" variable is equal to 1''  
*''Example: <Trigger Name="tWeasleyDead" Type="Var" Var="vWeasleyDead" Operator="==" Value="1" > - this fires when the "vWeasleyDead" variable is equal to 1''  


===[[ZoneCapture_Trigger|ZoneCapture]]===
=== [[ZoneCapture_Trigger|ZoneCapture]] ===
 
Fires when a region is captured.
Fires when a region is captured.


*'''Owner''' - Player who must capture this region to fire the trigger.  
*'''Owner''' - Player who must capture this region to fire the trigger.  
*'''Position''' - Map coordinates of the generator/Nexus.
*'''Position''' - Map coordinates of the generator/Nexus.

Revision as of 22:34, 17 January 2017

Triggers are what control anything you want to happen while the scenario is being played, from spawning starting base to calling waves of attacking enemies or giving players objectives. There are several types of triggers which activate off of different events.

Common Trigger Arguments

All triggers share some attributes in common:

  • Name - Name of the trigger. Required.
  • Type - What type of trigger it is. See below. Required.
  • Inactive - If this trigger is inactive, to activate use the ActivateTrigger option from another Trigger.
  • OtherTrigger - Name of another trigger that must have fired before this one will activate. Use this to set multiple conditions on a trigger occurring.
  • NotOtherTrigger - Inverse of OtherTrigger. If the other trigger has fired this trigger won’t fire. Us this to create branching options in your scenario.

Trigger Types

These are the types of triggers you can use in a script, and any specific arguments they support.

Area

Fires when the human player moves a unit into the area.

  • Center - Map coordinates of the center of the area. Required.
  • Size - Size of the area.
  • Template - Template name of the unit that can trigger this. If you want it to fire if any unit enters the area, do not specify a Template argument.

Build

Fires when a human player builds structures or units.

  • Target - The template of the building that will fire this trigger
  • IsBuilding - Set to "1" if the target is a building
  • Count - How many of the target template must be built to fire the trigger (default 1)

Destruction

Fires when something specific dies.

  • IsBuilding - If this is a building (if not it refers to a unit).
  • Target - Name of the script-spawned unit or building.

Difficulty

Fires at the beginning of a scenario if the given difficulty was chosen

  • Difficulty - The given difficulty (0 for Much Easier, up to 4 for Much Harder)

NamedCreate

Fires when a specific unit or building is spawned via a script.

  • Target - Name of the script-spawned unit or building.
  • IsBuilding - If this is a building (if not it refers to a unit).

Research

Fires when a player researches a Quantum Upgrade

  • Player - The player doing the research
  • Target - The name of the tech

Timer

Fires after a delay.

  • Time - Time in seconds after this gets triggered that it takes place.

Var

Fires if a variable meets given criteria

  • Var - The name of the variable to check
  • Operator - What logical operator to use when evaluating the variable (equal to, less than, etc) [ == | >= | <= | > | < | != ]
  • Value - The (integer) value to compare the variable against
  • Example: <Trigger Name="tWeasleyDead" Type="Var" Var="vWeasleyDead" Operator="==" Value="1" > - this fires when the "vWeasleyDead" variable is equal to 1

ZoneCapture

Fires when a region is captured.

  • Owner - Player who must capture this region to fire the trigger.
  • Position - Map coordinates of the generator/Nexus.