Age of Wonders II Heaven Julia with Gameplay background

Scenario Design
    Scripting Database

SHADOW MAGIC SCRIPTING
Scripting Database

Using Control Counter as a Workaround for Buggy Events

(Request Reply used with Gold Reward, Change Terrain used with Item Owned condition)

by Talon-Thorn

DOWNLOAD: sample scenario file

Outline:
A simple scenario showing how to use the Request event, how to set up a custom Quest, and how to control various events using the Control Flag event.

Scripts:
Control Counter is a very useful event that I've found essential when dealing with event bugs as a workaround. Using Request Reply with a Gold Reward event does not work properly, because for some unknown reason the Request Reply fires twice. To avoid this, a Control Counter is set, and then a Counter Change trigger is used to actually evoke the Gold Reward event.

Similarly, there is a problem with using a Change Terrain event with the condition Item Owned when an area is entered. It just doesn't work at all, even though the same trigger/condition works fine for showing messages. To get it to work, set a Control Counter event when the trigger/condition is satisfied. Then use a Counter Changed trigger to actually do the terrain change.

Side Note: terrain can not be changed to ice if on the surface level and the terrain has been elevated.

Setup:
See sample scenario file for details.

Details:


I won't go into as much detail on this one. Instead I'll just walk through it. See the sample scenario for the actual scripts used.

The scenario consists of an adventure where the player can pass through a teleport location (or go back), and is charged 100 gold each time he uses the teleport. The player has the option to refuse the teleport by turning down a Request Reply. Next, the player must find a certain item to get across a river. Once the item is found, a river hexagon is changed to ice, allowing the player to pass it.

For the first stage in the scenario, when a unit enters a "teleport" area, a Reply Request is sent. If the player responds "yes" then a Control Counter is used to add 1 to a counter (all counters are automatically initialized to zero at start of game). Another event has a Counter Change event, set to fire when counter = min/max 1. That trigger fires the Gold Reward event (for negative gold to charge for the teleport event).

Since the Reply Response trigger is firing twice (no idea why), it increments the counter twice. Once to 1 then to 2. The Gold Reward occurs on the first counter increment, but not the second. Another event is used to reset the counter back to zero (so that the teleport can be used again).

For the second stage in the scenario, the Change Terrain event does not want to fire when triggered by an Enter Area event that has condition AND Item Owned. For whatever reason, we don't care, since we are just going to use the workaround once again. Instead of triggering the Change Terrain event, the Enter Area event with condition AND Item Owned is going to evoke a Control Counter, adding 1 to it. Then a Counter Changed trigger set to go off at counter = min/max 1 will trigger a Change Terrain event to change a location to ice.

You should look at the actual working scripts in the sample scenario for more details.

Back to Event Scripting Resource Database Menu



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