Age of Wonders II Heaven Julia with Gameplay background

Scenario Design
    Scripting Manual

SHADOW MAGIC SCRIPTING
Triggers Manual

by Talon-Thorn

List of Triggers

* New event       ** Old event no longer available (but see notes)

 

NOTES

 
1) When a trigger is set off, its event occurs "immediately." However, the player order can sometimes cause this to seem otherwise. If an event is triggered by one player and viewed by another player, and the event is of a type that occurs only at the beginning of a turn (such as diplomacy), then the event will occur on the first turn the event-player has following the trigger-player, even if it is the next day. This is true even for simultaneous turn games in pbem and multiplayer-online.

For example, if we have player order "player A, player B," and for day 2 player B has a "New Turn" trigger that evokes a "Show Message" event for player A, player A will not see the message until day 3. On the other hand, if player A has a "New Turn" trigger to evoke a "Show Message" event for player B on day 2, player B will see the message on day 1 (since player 1's "new day" has not yet occurred).

2) For classic turn games, for any event, if the trigger-player's turn follows the event-player's turn, the event will not be viewable   by the player until the following day, but will be listed in the events log as having occurred on the day it was triggered.

 

Contact Player

DESCRIPTION: Trigger event when a player is first contacted by another player.

OCCURS: Once per game, immediately when "Viewing Player" player can see one of "Players" player's units or structures. Does not have to occur during the "Viewing Player" player's move. Trigger is tripped even if "Players" player moves a unit into view and then backs out of view (or vice versa).

 

SETTINGS:

 
 

Players

 
   

List of players who are to have first contact with "Viewing Player."

 
     

Required : Yes

 
     

Valid Values : One or more players, independents

 
 

Viewing Player

 
   

Player who's viewing area determines the trigger area.

 
     

Required : Yes

 

 

 

 

Valid Values : One player

 

 

Bidirectional

 

 

 

Undetermined

 

 

 

 

Required : Yes

 

 

 

 

Valid Values : False (default), True

 

NOTES:

 

-

This trigger has not been retested since patch 1.2.

 

Return to the Top

Counter Change

DESCRIPTION: Trigger event when specified counter is changed.

OCCURS: Immediately when counter's value is set to a value between the min and max specified values.

 

SETTINGS:

 
 

CounterID

 
   

ID number assigned to counter.

 
     

Required : Yes

 
     

Valid Values : Positive number.

 
 

CounterMin

 
   

Minimum value of counter.

 
     

Required : Yes

 
     

Valid Values : Positive number

 
 

CounterMax

 
   

Maximum value of counter.

 
     

Required : No

 
     

Valid Values : Number

 

NOTES:

 

-

This trigger has not yet been fully analyzed.

 

-

It is possible to set a timer on "New Turn" by using this trigger; normally setting timer with "New Turn" will simply fail. Use a "New Turn" trigger to set a counter to "1," then use this trigger set to go off on the value "1" with event "Set Timer."

 

Return to the Top

Diplomatic Action

DESCRIPTION: Trigger event when specified diplomatic action occurs.

OCCURS: When diplomatic event occurs.

 

SETTINGS:

 
 

PlayerFrom

 
   

Players who executes the diplomatic action.

 
     

Required : Yes

 
     

Valid Values : One player

 

 

PlayerTo

 

 

 

Player who is the target of the diplomatic action.

 

 

 

 

Required : Yes

 

 

 

 

Valid Values : One player

 

 

Action

 

 

 

Type of diplomatic action.

 

 

 

 

Required : Yes

 

 

 

 

Valid Values :

 

 

 

 

edaWar - PlayerFrom declares war on PlayerTo

 

 

 

 

edaPeace - PlayerFrom offers peace to PlayerTo

 

 

 

 

edaAlliance - PlayerFrom offers peace to PlayerTo

 

NOTES:

 

-

This trigger has not yet been analyzed.

 

Return to the Top

Enter Area

DESCRIPTION: Trigger event when a player's party enters specified area (but see notes).

OCCURS: This event is more appropriately titled: "change in party within area." A change can be 1) a party entering the area, 2) a party joining or leaving another party, where both start and remain within the area, or 3) a party attacking another party within the area.

 

SETTINGS:

 
 

Players

 
   

List of players who can trip the trigger.

 
     

Required : Yes

 
     

Valid Values : One or more players, (not) independents*

 
 

XYL

 
   

Coordinates on map upon which the trigger area is centered.

 
     

Required : Yes

 
     

Valid Values : Valid (X, Y, Level) coordinates

 
 

Radius

 
   

Radius distance in hexagons around the XYL location (where zero is the XYL hexagon only).

 
     

Required : No (default zero, or target hexagon only)

 
     

Valid Values : Positive number

 
 

StopMovement

 
   

Determines when the trigger is tripped and how this affects the triggering party.

 
     

Required : Yes

 
     

Valid Values : True (trigger is always tripped when party "changes" in the area, and party is stopped in the first hexagon it enters within the area), False (party is unaffected, and must have a move-destination within the area for the trigger to be tripped).

 

NOTES:

 

-

Entering the trigger area via teleporter sets off this trigger, as does the events "Teleport," "Spawn Unit," and "Units Join." A wizard respawning to a wizard tower sets off the trigger too, but only if it is not day 1.

 

-

Beware! If the event is set to activate "always," the trigger can fire multiple times in response to a single "change." I could not figure out what determines how many times the trigger fires. In one test, I had innumerable red dragons spawn from an "Enter Area" trigger tied to a "Spawn Unit" event!

 

*

This trigger does not work for independents!

 

Return to the Top

Explore Structure

DESCRIPTION: Trigger event when a specified structure is revealed by a player.

OCCURS: When fog of war hiding the structure is cleared for player.

 

SETTINGS:

 
 

Players

 
   

List of players who can trip the trigger.

 
     

Required : Yes

 
     

Valid Values : One or more players, independents

 
 

StructureID

 
   

ID number of the structure.

 
     

Required : Yes

 
     

Valid Values : ID of any city, tower, node, or resource site on the map

 

NOTES:

 

-

This trigger has not yet been analyzed.

 

Return to the Top

Flag Structure

DESCRIPTION: Trigger event when a specified structure is flagged by a player.

OCCURS: When structure is flagged.

 

SETTINGS:

 
 

Players

 
   

List of players who can trip the trigger.

 
     

Required : Yes

 
     

Valid Values : One or more players, independents

 
 

StructureID

 
   

ID number of the structure.

 
     

Required : Yes

 
     

Valid Values : ID of any city, tower, node, or resource site on the map

 

NOTES:

 

-

Josborne wrote: Capturing a Rift Node for the first time (ie. when the Rift Node is bound to your sphere) does not cause an event with a Trigger:Flag Structure event that is set to the Rift Node's ID to "trigger".

 

Return to the Top

Game Over

DESCRIPTION: Trigger event when a specified player has a specified amount of gold.

OCCURS: When player loses the game.

 

SETTINGS:

 
 

Players

 
   

List of players who can trip the trigger.

 
     

Required : Yes

 
     

Valid Values : One or more players

 

Return to the Top

Gold Reached

DESCRIPTION: Trigger event when a specified player has a specified amount of gold.

OCCURS: Once per game, when specified gold amount is first attained (see notes), due to income or spending.

 

SETTINGS:

 
 

Players

 
   

List of players who can trip the trigger.

 
     

Required : Yes

 
     

Valid Values : One or more players, independents

 
 

GoldMin

 
   

Minimum amount of gold to attain.

 
     

Required : Yes

 
     

Valid Values : Positive number

 
 

GoldMax

 
   

Maximum amount of gold to attain.

 
     

Required : No

 
     

Valid Values : Number

 

NOTES:

 

-

If GoldMax is less than GoldMin, trigger occurs when GoldMin is exceeded. Otherwise, player must have an amount of gold between GoldMin and GoldMax to trip trigger.

 

-

There seems to be no practical reason for using "independents."

 

Return to the Top

Interface Click

DESCRIPTION: Function and purpose of this trigger is unknown.

OCCURS: Undetermined.

 

SETTINGS:

 
 

InterfaceControl

 
   

The purpose of this field could not be determined.

 
     

Required : Unknown

 
     

Valid Values : Unknown. Text can be entered in this field.

 

Return to the Top

Kill Unit

DESCRIPTION: Trigger event when a specified unit is killed by player.

OCCURS: When specified unit is killed by a specified player (see notes).

 

SETTINGS:

 
 

Players

 
   

List of players who can trip the trigger.

 
     

Required : Yes

 
     

Valid Values : One or more players, independents

 
 

UnitID

 
   

ID number of unit who's death will set off the trigger.

 
     

Required : Yes

 
     

Valid Values : ID of any unit on the map

 

NOTES:

 

-

Prior to patch 1.2, this trigger could not deal with a situation where the unit was killed by independents.

 

-

Wizard units can not be "killed" when they have a wizard tower to respawn at after death. Thus, this trigger does not work for detecting the killing of a wizard unit unless the player owns no cities with wizard towers. Furthermore, when the wizard is killed he is not absent from the world if he has at least one wizard tower; thus, it isn't possible to "detect" the killing of a wizard by use of the "unit in area" condition.

 

Return to the Top

Mana Reached

DESCRIPTION: Trigger event when a specified player has a specified amount of mana.

OCCURS: Once per game, when specified mana amount is first attained (see notes), due to income or spending.

 

SETTINGS:

 
 

Players

 
   

List of players who can trip the trigger.

 
     

Required : Yes

 
     

Valid Values : One or more players, independents

 
 

ManaMin

 
   

Minimum amount of mana to attain.

 
     

Required : Yes

 
     

Valid Values : Positive number

 
 

ManaMax

 
   

Maximum amount of mana to attain.

 
     

Required : No

 
     

Valid Values : Number

 

NOTES:

 

-

If ManaMax is less than ManaMin, trigger occurs when ManaMin is exceeded. Otherwise, player must have an amount of mana between ManaMin and ManaMax to trip trigger.

 

Return to the Top

New Turn

DESCRIPTION: Trigger event at the beginning of a new turn.

OCCURS: At the beginning of a turn, before all other triggers.

 

SETTINGS:

 
 

Players

 
   

List of players who can trip the trigger.

 
     

Required : Yes

 
     

Valid Values : One or more players, independents

 

Return to the Top

Pickup Item

DESCRIPTION: Trigger event when a specified item is picked up by player.

OCCURS: Each time specified item is picked up by a specified player.

 

SETTINGS:

 
 

Players

 
   

List of players who can trip the trigger.

 
     

Required : Yes

 
     

Valid Values : One or more players, independents

 
 

ItemID

 
   

ID number of an item.

 
     

Required : Yes

 
     

Valid Values : ID of any item in the items list

 

Return to the Top

Quest

DESCRIPTION: Trigger event when a specified quest is complete.

OCCURS: When quest is complete (as specified by a "Spirit Quest Control" event), or if quest offer is declined.

 

SETTINGS:

 
 

Players

 
   

List of players who can trip the trigger.

 
     

Required : Yes

 
     

Valid Values : One or more players, independents

 
 

Outcome

 
   

Outcome of quest.

 
     

Required : Yes

 
     

Valid Values : Pre-defined quest outcome type. Choose from: qoSucceeded, qoFailed, qoDeclined

 
 

QuestID

 
   

Unique, user-defined ID number for quest.

 
     

Required : Yes

 

 

 

 

Valid Values : Positive number

 

NOTES:

 

-

There seems to be no practical reason for using "independents."

 

Return to the Top

Raze Structure

DESCRIPTION: Trigger event when a specified structure is razed by player.

OCCURS: Each time specified structure is razed by a specified player.

 

SETTINGS:

 
 

Players

 
   

List of players who can trip the trigger.

 
     

Required : Yes

 
     

Valid Values : One or more players

 
 

StructureID

 
   

ID number of the structure.

 
     

Required : Yes

 
     

Valid Values : ID of any city, tower, node, or resource site on the map

 

NOTES:

 

-

Prior to patch 1.2, this trigger could not deal with a situation where the structure was razed by independents.

 

Return to the Top

Rebuild Structure

DESCRIPTION: Trigger event when a specified structure is rebuilt by player.

OCCURS: Each time specified structure is rebuilt by a specified player.

 

SETTINGS:

 
 

Players

 
   

List of players who can trip the trigger.

 
     

Required : Yes

 
     

Valid Values : One or more players, independents

 
 

StructureID

 
   

ID number of the structure.

 
     

Required : Yes

 

 

 

 

Valid Values : ID of any city, tower, node, or resource site on the map

 

NOTES:

 

-

This trigger has not been retested since patch 1.2

 

Return to the Top