Age of Wonders II Heaven Julia with Gameplay background

Scenario Design
    Scripting Manual

SHADOW MAGIC SCRIPTING
Using Conditions

by Talon-Thorn

The Conditions List on the Events Main Tab allows you to set up complex conditions in combination with the trigger to create very specific event triggers. This article will show you how to make use of the logical operators so that you can correctly build complex triggers for your scripts.

Each condition in the list is set up with either an AND, AND NOT, OR, or OR NOT logical operator*, so you will need to know a little about basic logic to use this section. Basically, AND links conditions together so that all consecutive AND conditions must be true for the event to occur. OR conditions create a break in the list of conditions so that the event occurs on the trigger if either all conditions before the OR or after the OR are satisfied.

For example, if you have the following:

  1. AND cond1
  2. AND cond2
  3. OR cond3
  4. AND cond4
  5. OR cond5
  6. AND cond6

The event will occur when the trigger is tripped and either 1) cond1 and cond2 are true, or 2) cond3 and cond4 are true, or 3) cond5 and cond6 are true.

One way of stating this is to say that AND has higher precedence than OR, but if that has no meaning to you, ignore it and just go by the example.

AND NOT and OR NOT work in the same way, except the conditions must be false. Thus, for example:

  1. AND cond1
  2. AND NOT cond2
  3. OR NOT cond3
  4. AND cond4
  5. OR NOT cond5
  6. AND NOT cond6

This arrangement will cause the event to occur when the trigger is tripped and 1) cond1 is true and cond2 is false or 2) cond3 is false and cond4 is true or 3) cond5 and cond6 are false. (NOT has a higher precedence than AND and OR.)

* Note: The first condition in the list can only be set to AND or AND NOT

Hopefully, this short tutorial will be enough to answer all your questions. However, should you require further assistance, be sure to ask your fellow map makers by posting your question in the Scenario Design Forum.

BACK TO SCENARIO DESIGN MAIN MENU

HG Logo

Headlines

» AoW1 Summer 2008 Mapmaking Tournament

» Interview Kirky Picardo

» Scenario update

» The making of...

» A new PBEM Singles Champion is crowned - Swolte!!

Poll

What unit most resembles you?

Halfling peasant

Undead Vampire

Human Knight

Tigran Prowler

Orcish Warlord

Archon Saint

Dwarven Engineer

Chaos Spawn

Results :: Other Polls

Age of Wonders

Looking for info about the original AoW?
Visit AoW Heaven!

AoWH Logo

HeavenGames Sites

» Main Portal

» Age of Empires

» Age of Empires 3

» Age of Kings

» Age of Mythology

» Age of Wonders

» Age of Wonders 2

» Battle for Middle Earth 2

» Caesar 3

» Caesar 4

» Children of the Nile

» Dungeon Siege

» Empire at War

» Empire Earth

» Emperor: RotMK

» Medieval 2: Total War

» Pharaoh

» Rise & Fall: CaW

» Rise of Legends

» Rise of Nations

» Rome: Total War

» Stronghold

» Stronghold 2

» SW: Galactic Battlegrounds

» Zeus