Quest Var Guide

By Elpea
created 11/12/03

The AoM:TT editor brough up a new, intresting set of condition and effects, with these it is possible to create endless creative scenarios. One intresting new addition are Quest Vars. Quest Vars are variables that can be created, checked, compared, and modified using triggers.

Setting and Checking Quest Vars:
Quest Vars can be set with the Quest Var Set effect, you can set the Quest Var whenever something in the scenario happens (example: player has 100 food), by the same way you would fire any other effect on the scenario.
So let’s say we will set the Quest Var “animal” to 1 whenever the player type “Donkey” in the chat. We will fist create a Trigger, check the run immediately box (so the trigger is fired immediately) and click on conditions, click on the select box and choose: Chat Contains , set the Text to “Donkey”, leave the player box as 1, doing so you have just set up so if Player 1 types Donkey on the Chat box, the effect , which will be covered next, will happen, here’s how the condition should look like:

Now click on the effects button, and click on the drop down list again, this time the list of effects will show up, find Quest Var Set, once you found it, it should have 2 things, Var Name and Value, you can pick any var name, but to do our example, name it “animal”, set the value to 1.
There! you did it! you have now set a variable!, well, what is the use of a variable if you don’t use it right? well, this is just the tip of the iceberg.

Now we need to use that value we have set for something, well, to keep our example going, let’s make it so if variable “animal” is equal to 1, we message the player with a nice message. First, set up a new trigger, check the fire immediately box and click on the conditions button, you should now click on the drop down list again, which will show you that list of conditions. From the list, select the Quest Var Check condition, it will contain 3 values, Var Name, Operator, and Value. This is a basic x+y+z thing, X is the Var Name, which in this case, we want to check if the var we have set previously (animal) is 1, Y being the operator, and Z being the value, I could make it so it says: “animal < 2” or “animal = 1” or even “animal > 0”, but since all we want is for it to check if animal is exactly 1, we will set the Var Name to “animal”, the Operator to “= =” and the Value to “1”.

Now we need to set up an effect in case the variable does = 1, so we click on the effects button, and on the list again, this time pick Message. The Message effect should contain 2 boxes, Text and Timeout, the timeout is measured in milliseconds, so put in how many miliseconds you want your message to go on for, As for the message, type in whatever you want, as for me, I am putting : “You are l337”. You are all done! AoM will check if the variable “animal” equals 1, if it does, it will message the player with whatever you put in!
Here’s what you have just set up:
Trigger 1:”If player types in “Donkey”, set variable “animal” to 1″
Trigger 2:”If variable “animal” equals 1, message the player”.

Pretty easy right? Well, we aren’t done yet.

Quest Var Modify:

So, Donkey isn’t the only cool animal right? We want it so if everytime the player types a cool animal name he gets a “point” , so let’s get started.
First of all, start a new map, and create a new trigger. And make a new condition, from the list select Chat Contains , again, put the player as 1 and the text as “Monkey”. Click on the effects button and set the effect to Quest Var Modify , this effect is similar to Quest Var Set but instead of setting it to a certain value you pick, it just does any math operations (add, subtract, multiply, divide…) from the current value, right now, we will add 1, so set the name to whatever you like (let’s use “points” for the example) operator to “+” and the Value to “1”.
Make more triggers with the same thing, but instead of the Chat Contains value being “Monkey”, set up other animals you like, make 5 of those.
Make a new trigger, this time, click on conditions and select our old Quest Var Check condition, for Var Name put our variable name, which is “points” , set the operator to “= =” and the Value to 1. Now click on the effects tab and click on the list and select Message , for the message, put in “You have Scored 1 point!”. So basicly, what you just did was make it so if the player types any of the animals name he gets 1 point, and when he gets 1 point he is notified with a message. Make the same trigger for points 2, 3, 4, and 5.
You have just made a nice little animal name guessing game, of course, you can go further and do a Riddle scenario, or anything you can come up with.

Quest Var Randomize:

Random was something not possible on the original AoM, now you can pretty much do any random events, let’s get down to learning shall we? For our example, we will have a map where the player starts with a random unit, the first step is to create a new map, start clean. Create a new trigger and click on the effects button, on the effects list select Quest Var Randomize , when you get to it, you will see something like this:

It should look pretty obvious to you now, Var name can be anything you would like as always, but for the example we will use “Hero” for the var name, now, we must think: “How many options do I want?”, so let’s say, for our random Hero we will have 3 different ones, so we put the Min Value as 1, and the Max Value as 3 (rounding should be always on, unless you put something like: Min Value .1 and Max Value .3). Well, now make another trigger with our good friend, the Quest Var Check as the condition, Var Name being “Hero” and the Value being 1. The effect can be Unit Create, pick the unit who will be hero 1 and select a place for it to be created. This trigger is basicly asking: “If Variable Hero = = 1, create Hero number 1”. Now do the same trigger but the Quest Var Check values being 2 with a different Hero, and another with Quest Var Check being 3 with another Hero. There you go, the player will now start the game with one of them, totally random, it can be used on other things too, like placing enemy on the map, random Town Center location, whatever your imagination brings up.

Back to the Advanced Section