Trigger Basics + Tutorial

Discussion in 'Custom Scenario Tutorials' started by NCSGeek, Jun 21, 2018.

  1. NCSGeek

    NCSGeek Moderator
    Staff Member Moderator

    Joined:
    Oct 24, 2017
    Messages:
    245
    Likes Received:
    34
    Trophy Points:
    28
    What are Triggers?
    Triggers are what every scenario needs to be functional. Objectives, Win/Lose conditions, special events, etc are all done via triggers. A trigger is composed of two main parts; Conditions and Effects. Simply put, the Conditions control when the trigger runs, and the Effects control what the trigger does when it runs.
    You can access triggers via the "Triggers" menu at the top of the editor. Here is a breakdown of the GUI you will see.
    [​IMG]
    (The others menus, "Group Editor" and "Army Editor", will be explained later)
    (Larger version)

    Fundamental/Necessary Triggers
    There are triggers that every functioning scenario should have. Most important being a trigger with the "__OfflineScenarioInit" effect. You need a trigger with that effect to run at the start of the game. (Use the "Run Immedietly" option). Then, you'll generally want a trigger for both how to Win, and how you can Lose. An example of a trigger for how to win, could be:
    Condition: "Is Dead" (Set to the enemy town center)
    Effect: "Win Message"

    Then, you can do the same for losing, except set the "Is Dead" to the player's town center. ("Win Message" is reused for losing too.)

    The rest of the gameplay is up to you!

    Applying the Knowledge
    Now, to apply all of this to bring your idea to life! Say you want the player to win if they do X and also Y, you will have a trigger with conditions to check if X & Y are done, and the effect would be "Win Message" and anything else you may want done if the player wins. It's just a matter of turning your idea, to triggers. That involves looking at the list of conditions/effects and finding which of them fit your idea the most. You can also do things like scripted event, say for example, if the player reaches a certain age, or has a certain amount of resources, then an army attacks the player. This would be done with a condition to check the age/resources (or whatever you wanted to check) then have an effect for "Army Move" (With attack-move enabled) set to move to the player's base.

    Groups and Armies:
    Groups are simply groupings of triggers. They do not effects the gameplay at all and are just for organization while you are editing. Below is a screenshot of the group editor menu.
    [​IMG]
    On the left, you see the list of groups, and Insert/Delete buttons. On the right you edit the group's name and see the triggers within that group. Selecting "Triggers" on the left under the "Edit:" text is for managing triggers and moving them to different groups.

    Then the army editor. 'Armies' are simply just groups of units. These exist for triggers to work with groups at one time, and have them attack/move, etc. Below is the editor for armies.
    [​IMG]
    You'll see the list of current armies on the left, then the on the right you can create a new army, or manage the selected one. When creating a new army, you need to have the units that you want the army to be composed of selected. Mousing-over most of these buttons will result in helpful tooltips. You use these 'Armies' wherever an effect/trigger calls for it. (For example; "Army Move")

    Effect and Condition Documenation:
    Link coming soon!​
     
    #1 NCSGeek, Jun 21, 2018 at 1:05 PM
    Last edited: Jun 25, 2018
  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice