Age of Empires Forums


  advanced
in


Last post 04-24-2012, 2:00 PM by KaptainNemo. 20 replies.
Page 1 of 2 (21 items)   1 2 Next >
Sort Posts:
  •  01-27-2011, 4:49 PM 909609
    musketeer925 musketeer925 is not online. Last active: 03-13-2014, 9:15 PM
    Member
    Head of Custom Content (Unofficial)
    Top 25 Contributor
    Total Posts: 4,013
    Last Post: 03-13-2014
    Member Since: 05-18-2009
    Subject: Scenario Trigger Tutorial

    As my 1000th post, I've decided to write a general guide to Triggers. (Mainly for multiplayer but many of these concepts will also apply to Single-Player. I will note it if it does not apply to single player.)

    A side note: I have Reyk's Editor Mod and I highly recommend it. If you choose not to download and install it, my pictures of menus may look slightly different than your results.

    Triggers

    Triggers are the brain of a scenario. The map and design make your map look nice, but trigger make it run.

    Without triggers, you have a map and perhaps a few handfuls of units. There is no way to actually win or be defeated without triggers.

    Basics

    Let's start off by learning the basics of a trigger. The first thing we must do is find the trigger menu.

    The main trigger menu will be under Triggers -> Triggers as show in the picture. We'll get to groups and armies later.

    This is the main trigger UI:

    Now that's a lot of buttons! Here's a list of what the ones in the Trigger Editor area do:

    Button                   Effect
    Insert                   Inserts a new trigger.
    Del                      Deletes the selected trigger.
    Copy                     Copies the selected trigger.
    Conditions               View and edit conditions of the selected trigger.
    Effects                  View and edit effects of the selected trigger.
    Alle Trigger kopieren    Copy all triggers [Reyk's Editor Only.]
    Alle Trigger laden       Paste all triggers (Warning: This will OVERWRITE all triggers currently in the scenario.) [Reyk's Editor Only.]

    The area beside it is the area in which you will actually edit a trigger. Let's insert a trigger, and then learn this next area.

    This is what I like to call the Trigger Overview panel.

    It shows a general overview of the trigger and lets you change a few things -- the name, its priority, and its rules (Active, Loop, and/or Run Immediately). It also shows a list of all the conditions and effects.

    As you can see, when you insert a trigger is is called 'Trigger_x' (with x being a number). Its default rules are active, its priority normal, and it has the Always Condition and the SetIdleProcessing Effect.

    Let's have a list of what the buttons, boxes, and entry fields here do.

    Button            Effect
    Name              Change the trigger's name
    Active            Set a trigger to active, so it will run. Inactive triggers will not run unless active.
    Loop              A looped trigger will run repeatedly.
    Run Immediatelty  A trigger set to Run Immediatly will run as soon as the game starts (when also active) -- without this, it will take a few seconds to run.
    Priority          Set the triggers priority. Triggers with the highest priorty will run before triggers that have lower priority. 

    Conditions

    Conditions are what causes the trigger to execute its effects. While an active trigger starts at the beginning of the game, its effects will not be executed until its conditions are fufilled.

    Conditions are checked in the order they are placed. If an always is placed before a timer, it will check always to make sure it is true before checking the timer. Otherwise, it would check the timer before checking Always. (Note: Always will... always be true and there is no reason to have it paired with other conditions.

    The Conditions panel has a few buttons:

    Button         Effect
    Insert         Inserts a new condition.
    Delete         Deletes the selected condition.
    Copy           Copies the selected condition.
    Or             Makes it so only one of many conditions must be fufilled for the effects to be executed. By default ALL conditions must be fufilled.
    Not            Not. Makes it so when conditions are not fufilled the effects are executed. Not also inverts the Or button, so when or is not checked if only one condition is NOT true, then it will run. When or is checked, all conditions must be not true.

    The dropdown menu that says 'Always' will allow you to select different conditions.

    Also, when you have a condition other than Always selected, there may be parameters that you can fill out to make the condition more customizable.

    Here are some parameters:

    I'll talk more about parameters in the Effects section.

    Effects

    Effects are the meat of a trigger - they make it actually do something. The effects are run when the conditions are fufilled. Effects of a trigger will only run once unless it is looped or fired. (I'll discuss firing later.)

    Effects, like conditions, run in the order that they are placed. The effects menu will look just like the Conditions Menu.

    We're going to learn about these by just using some, so, let's finally make our first trigger.

    Because I'm also a programmer, we're going to start out with the classic -- Hello World. What we want to do is make a trigger that makes one of the Players send a chat containing the words "Hello World!".

    First, we'll insert a trigger (if you haven't already). You can rename the trigger to Hello_World, if you like. Since, for now, we want this trigger ot run instantly, we'll leave the condition as Always. Moving on to your effects, the one you want is "Send Chat".

    We just have two parameters for Send Chat. One is titled 'From Player', while the other is titled 'Message'. We can leave 'From Player' as 1 (so it looks like Player 1 is saying the contents of the 'Message' box) for now, but we'll change the message from 'default' to 'Hello World!' (without the quotes).

    Your Effect should look like this:

    And the Trigger Overview should look like this:

    (Note: The trigger name can be anything you want, as long as it isn't the same as another trigger and doesn't contain anything other than letters, numbers, and underscores ( _ ). The name has no effect on how the trigger runs.)

    Now let's Playtest and see the magic!

    And here it is:

    Quest Vars [Section Added March 8, 2011]

    QVs (Quest Vars) are a way to save numbers in your scenario. QVs can be set, randomized, and modified. They can be used to keep track of Player Stats, Unit Stats, or really anything that is a number. They are saved from trigger to trigger, and are often used in randomization -- a thing that cannot otherwise be achieved in a scenario.

    QVs can be constructed in a way to create complex formulas and do other math.

    The default triggers that come with the game to deal with QVs are 'Quest Var Set', 'Quest Var Modify', 'Quest Var Modify 2', 'Quest Var Copy', 'Quest Var Randomize', and 'Quest Var Check'.

    QV Conditions and Effects
    Quest Var Set:        Sets a QV. It overwrites anything that was already in the QV of that name.
    Quest Var Modify:     Modifies a QV. It adds to, subtracts from, multiplies, or divides a QV. Keep in mind that the symbol for multiplication is an asterisk ( * ) and the symbol for division is a forward slash ( / ).
    Quest Var Modify 2:   Modifies a QV by another QV. It lets you add/subtract/multiply/divide two QVs together. It's good to know that this only affects the first QV though, the QV that you are modifying it by is not changed.
    Quest Var Randomize:  Randomizes a QV. It overwrites anything previously in that QV. This is a very useful trigger. When paired with Quest Var Check, it can be very useful in making random events.
    Quest Var Check:      [Condition] Checks a QV based on the given parameters. Can be Greater Than ( > ), Less Than ( < ), Greater Than or Equal To ( >= ), Less Than or Equal To ( <= ), or Equal To ( == ).
    Quest Var Copy:       Copies one QV to another. The original is not affected.
    

    There are countless custom QV triggers that have many uses. I'll add descriptions of some of the most important in later editions of this tutorial.

    This tutorial is obviously not finished, but now that you know the very basics, you can screw around with different effects and conditions to see what you can do!

    Future additions will list and explain important conditions and effects, illustrate triggers that are necessary to have in all scenarios, explain Quest Vars & Randomization, explain more complex trigger sequences, and talk about cutsom triggers.

    Until then, I'm open to questions & comments, and I wish you Good Luck if you are a new designer!

  •  01-27-2011, 10:02 PM 909643 in reply to 909609
    Prawny Prawny is not online. Last active: 04-11-2012, 11:16 PM
    Member
    Banland
    Top 100 Contributor
    Total Posts: 1,458
    Last Post: 11-04-2012
    Member Since: 08-07-2009
    Subject: Re: Scenario Trigger Tutorial
    lol @ doing helpful stuff when your post count reaches a significant number
  •  01-28-2011, 1:42 PM 909728 in reply to 909643
    musketeer925 musketeer925 is not online. Last active: 03-13-2014, 9:15 PM
    Member
    Head of Custom Content (Unofficial)
    Top 25 Contributor
    Total Posts: 4,013
    Last Post: 03-13-2014
    Member Since: 05-18-2009
    Subject: Re: Scenario Trigger Tutorial
    Prawny:
    lol @ doing helpful stuff when your post count reaches a significant number
    I know, right?

    Essentially, it was just motivation for me to get something posted. Otherwise, I never would have completed anything without a timeframe for me to do it by.

  •  03-08-2011, 3:47 PM 915095 in reply to 909728
    musketeer925 musketeer925 is not online. Last active: 03-13-2014, 9:15 PM
    Member
    Head of Custom Content (Unofficial)
    Top 25 Contributor
    Total Posts: 4,013
    Last Post: 03-13-2014
    Member Since: 05-18-2009
    Subject: Re: Scenario Trigger Tutorial
    I've now added a section on QVs.
  •  03-08-2011, 5:16 PM 915117 in reply to 915095
    TychoPsycho TychoPsycho is not online. Last active: 01-08-2014, 12:00 PM
    Member
    In my casino
    Top 50 Contributor
    Total Posts: 2,905
    Last Post: 01-08-2014
    Member Since: 08-10-2010
    Subject: Re: Scenario Trigger Tutorial

    Musketeer925:
    I've now added a section on QVs.

    I still don't understand wat a quest var is or does?


    Alicorn700:

    wat up niggas
  •  03-08-2011, 5:38 PM 915131 in reply to 915117
    IrjaOwnsAll IrjaOwnsAll is not online. Last active: 10-03-2012, 2:08 PM
    Member
    Finland, where Irja + ZaGe = 21 OP
    Top 150 Contributor
    Total Posts: 1,367
    Last Post: 10-03-2012
    Member Since: 02-05-2011
    Subject: Re: Scenario Trigger Tutorial
    could you pls simplify how can I make a trigger that forces my skirmisher to fart into an Imperial Musketeer's face exactly at 69 minutes?
  •  03-08-2011, 6:28 PM 915153 in reply to 915117
    musketeer925 musketeer925 is not online. Last active: 03-13-2014, 9:15 PM
    Member
    Head of Custom Content (Unofficial)
    Top 25 Contributor
    Total Posts: 4,013
    Last Post: 03-13-2014
    Member Since: 05-18-2009
    Subject: Re: Scenario Trigger Tutorial
    tycho.psycho:

    Musketeer925:
    I've now added a section on QVs.

    I still don't understand wat a quest var is or does?

    Did you read it?

    Have you taken a pre-algebra class?

  •  03-09-2011, 4:17 AM 915196 in reply to 915153
    Prawny Prawny is not online. Last active: 04-11-2012, 11:16 PM
    Member
    Banland
    Top 100 Contributor
    Total Posts: 1,458
    Last Post: 11-04-2012
    Member Since: 08-07-2009
    Subject: Re: Scenario Trigger Tutorial
    It needs to be dumbed down more to suit the people that frequent this forum
  •  03-09-2011, 11:54 AM 915230 in reply to 915196
    IrjaOwnsAll IrjaOwnsAll is not online. Last active: 10-03-2012, 2:08 PM
    Member
    Finland, where Irja + ZaGe = 21 OP
    Top 150 Contributor
    Total Posts: 1,367
    Last Post: 10-03-2012
    Member Since: 02-05-2011
    Subject: Re: Scenario Trigger Tutorial

    Prawny:
    It needs to be dumbed down more to suit the people that frequent this forum

    +1 i agree

  •  03-19-2011, 12:12 PM 916648 in reply to 909728
    Dark star753 Dark star753 is not online. Last active: 05-21-2011, 8:31 PM
    Member
    Not Ranked
    Total Posts: 23
    Last Post: 05-21-2011
    Member Since: 03-17-2011
    Subject: Re: Scenario Trigger Tutorial
    Can you help? I'm stuck on a scenario! I need to increase a dogs health and change a dogs name! I have no idea how to start and I'm really dumb so please make sure a monkey can understand it! Thanks in advance! 
  •  03-19-2011, 12:15 PM 916649 in reply to 915196
    Dark star753 Dark star753 is not online. Last active: 05-21-2011, 8:31 PM
    Member
    Not Ranked
    Total Posts: 23
    Last Post: 05-21-2011
    Member Since: 03-17-2011
    Subject: Re: Scenario Trigger Tutorial
    I cant understand it!!!I'm too dumb!!!
  •  03-19-2011, 12:23 PM 916650 in reply to 916648
    kjn kjn is not online. Last active: 09/03/2011, 6:25 PM
    Member
    Top 10 Contributor
    Total Posts: 5,629
    Last Post: 09-03-2011
    Member Since: 12-24-2005
    Subject: Re: Scenario Trigger Tutorial

    Dark star753:
    Can you help? I'm stuck on a scenario! I need to increase a dogs health and change a dogs name! I have no idea how to start and I'm really dumb so please make sure a monkey can understand it! Thanks in advance! 

    To increase the dog's health..Try the "Modify proto unit" effect..Some of the fields will work..Try the "healing rate/range" field..It is known to work for some units..You can also try using the "Hitpoint" HP field..Another option is.."Unit make invulnerable" effect..

    http://wiki.heavengames.com/age/Modify_protounit

    To change the dog's name..You could try "Change name effect"

    http://wiki.heavengames.com/age/Change_name

    The only other way I know of is modding.

    Regards

  •  03-19-2011, 2:44 PM 916662 in reply to 916650
    Dark star753 Dark star753 is not online. Last active: 05-21-2011, 8:31 PM
    Member
    Not Ranked
    Total Posts: 23
    Last Post: 05-21-2011
    Member Since: 03-17-2011
    Subject: Re: Scenario Trigger Tutorial

    Thanks for the info I think I can start making some good scenarios now lol!" style="color: black; " href="http://forum.agecommunity.com/tiny_mce/jscripts/tiny_mce/plugins/smilies/smilies.htm"> 

  •  03-20-2011, 6:43 AM 916741 in reply to 916662
    Dark star753 Dark star753 is not online. Last active: 05-21-2011, 8:31 PM
    Member
    Not Ranked
    Total Posts: 23
    Last Post: 05-21-2011
    Member Since: 03-17-2011
    Subject: Re: Scenario Trigger Tutorial

    How do you trigger something like when you go to a tree 5 men pop up? or men rapidly show in one area. Thanks! a lot for everything! 

  •  03-20-2011, 7:58 AM 916748 in reply to 916741
    kjn kjn is not online. Last active: 09/03/2011, 6:25 PM
    Member
    Top 10 Contributor
    Total Posts: 5,629
    Last Post: 09-03-2011
    Member Since: 12-24-2005
    Subject: Re: Scenario Trigger Tutorial

    Hello again,

    The condition you want may be "Units in area"?

    To spawn the five units "Unit create multi" Effect. To find out more on them use the link I gave in the above post.

    Regards

Page 1 of 2 (21 items)   1 2 Next >
View as RSS news feed in XML