






Age of Wonders II
is a turn-based strategy game developed by
Triumph Studios

![]() |
![]() |
Control FlagsPosted by: Lonely Tower (07-22-2002) on the AOW2 Scenario Forum "Flags" are one of the techniques that programmers employ in coding and it is basically use to keep track of whether a situation is true or false. Think of flags as a switch -- it is either on, or it is off. Hence, you can use it to keep track if the player has
achieved something. Event Type: Control Flag Leave the conditions as it is. Basically, what you have is a script that set Flag 1 to True when the player picks up ItemID 44, the Night Cloak (You can check the ItemID by clicking on the item bag on the map). The "Activate: Once" ensures that the event will not be repeated. There's something rather strange here. The "Active: True" does not refer to the default setting of the flag. It means "Set the flag to true" (it's a bit misleading). So, if you want to set a flag to false, change the Active setting to "false". And techically speaking, if you do that, the flag is true to begin with (though I haven't tested that...) Next, we have a script that accuse the player of picking up the item. This script is a bit complicated, so keep a sharp mind! Type: Show Message So far, so good! Now, we have to explain about conditions. Heard of the term 'conditional love' before? "If you pass your examination mommy will get Age of Wonders 2 for you!" In computer speak, such a conditional love statement can be rendered as: IF it is true that I have passed my examination THEN Mommy will get AoW2 for me. To make it look more like a computer language: IF pass examination=true then get AoW2 from Mommy So you use conditions to 'control' whether an event actually happens. For example, we will not want to show the above message if the player haven't pick up the Night Cloak. Hmm...how do we know whether the player has picked up the Night Cloak?? Right, now click on the "Conditions" tab (it's at the top, next to the Main tab), and click on the NEW button. The default condition, "Area Visible" will pop up. Change it to "Flagged" (kudo points if you can guess how this is going to end). Type in a name for your condition. An example could be "Night Cloak has been picked up". Next to the FlagID row put "1". This corrosponds to the first flag you create in the first script above. Now we can resume our scripting. Click on the Main tab and alter the conditions as below Conditions: Alright, so you think it's far easier (and smoother!) to use the "Pickup Item" trigger than to do this, but it is just an example .SOME COOL IDEAS ON HOW TO USE FLAGS - You can keep track of nefarious deeds that the players have done. Did he razed the innocent halfing town just to complete the Spirit of War quest? Well, don't expect Elves or the Spirit of Nature to be too kind to you! Wait, there's more! How about giving the wayward player another quest to redeem himself that sets the flag to false? To do this, set a flag that becomes true when the player razes the halfing town and whenever the player comes in contact with the Marinus or the like, check whether the flag is true. If yes, then Marinus will be hostile towards the player. - Conflicting Deities. Two deities offer you a quest but you can only take one. Once the first quest is furfiled, set a flag to true and immediately cause the other quest to fail (you have to know a bit about quests first). You can also alter NPCs behaviours, random events because of this flag (for example, you have taken a Spirit of Nature quest and now your units will not trigger Divine Storms anymore) - Create an item, such a ring, that gives 100 gold per turn to the player. Create a "New Turn" event with "Activate: Always" and check if the item is owned. Wait a moment, if we can do this, why bother with the flag? You can create a storyline that this ring is owed by a powerful wizard and he is quite mad that you have attempted to steal it. Whether you still have the ring or not doesn't matter... |
Headlines » AoW1 Summer 2008 Mapmaking Tournament » A new PBEM Singles Champion is crowned - Swolte!! Poll Age of Wonders Looking for info about the original AoW? HeavenGames Sites » Caesar 3 » Caesar 4 » Pharaoh » Zeus |
|
Age of Wonders II™ is a game by Triumph Studios and published by Gathering of Developers. Age of Wonders II Heaven Copyright © 1997-2004 HeavenGames LLC. All Rights Reserved. Written permission is required if you want to use any materials published on this website for use on your own website, in its original form, or translated into other languages. |