1. Updated Resource Submission Rules: All model & skin resource submissions must now include an in-game screenshot. This is to help speed up the moderation process and to show how the model and/or texture looks like from the in-game camera.
    Dismiss Notice
  2. DID YOU KNOW - That you can unlock new rank icons by posting on the forums or winning contests? Click here to customize your rank or read our User Rank Policy to see a list of ranks that you can unlock. Have you won a contest and still haven't received your rank award? Then please contact the administration.
    Dismiss Notice
  3. Ride into the sunset with the 32nd Modeling Contest. The contest is optionally paired. Best of luck, people!
    Dismiss Notice
  4. This adventure has come to an end. Congratulate our heroes in the 16th Mini Mapping Contest Results.
    Dismiss Notice
  5. From the gates of hell, the 5th Special Effect Contest Results have emerged.
    Dismiss Notice
  6. Race against the odds and Reforge, Don't Refund. The 14th Techtree Contest has begun!
    Dismiss Notice
  7. Check out the Staff job openings thread.
    Dismiss Notice
Dismiss Notice
60,000 passwords have been reset on July 8, 2019. If you cannot login, read this.

Basics of Triggers

Discussion in 'Trigger (GUI) Editor Tutorials' started by Archian, Apr 3, 2007.

  1. Archian

    Archian

    Site Director

    Joined:
    Jan 1, 2006
    Messages:
    2,902
    Resources:
    12
    Skins:
    1
    Tutorials:
    11
    Resources:
    12
    Note, that the tutorial is still in progress. Feel free to post comments & suggestions for improval :)

    Basics of Triggers
    By Archian

    My ten-year-old cousin has just started warcraft III modding, and has begun experimenting with the Trigger Editor.
    I promised that I would make a little tutorial relating to how to make some *very* basic, but useful triggers for custom maps.
    This tutorial is also meant as a source of information that may encourage newcomer's to start triggering and from there, develop their knowlege.
    So when you're done reading this tutorial, go inside the World Editor and do some experimenting yourself :)
    Click the images for larger versions.

    The "target group" of this tutorial is of course; beginners.

    Table of Content


    [point]Introduction to The World Editors' "Trigger Editor"[/point]
    [​IMG] Introduction to The World Editors' "Trigger Editor"
    The trigger editor is where the map script is written, either in GUI triggers or directly in JASS.
    The map script controls any in-game events not dictated by the user. Triggers are essential for creating maps with complicated goals and atmosphere.

    Trigger Editor: (Menu Bar\Module\Trigger Editor) TriggerEditor.jpg

    TriggerModules.jpg
    (From left to right: Variables... (Ctrl+B), New Category (Ctrl+G), New Trigger (Ctrl+T), New Trigger Comment (Ctrl+M), New Event (Ctrl+E), New Condition (Ctrl+D), New Action (Ctrl+R).

    Button: Functions:
    Variables....jpg Variable Editor ~ [​IMG] MrApple's Beginner's Guide to Variables.
    NewCategory.jpg Creates a new category for triggers; useful in custom maps with many triggers to keep a better overview.
    NewTrigger.jpg Creates a new trigger.
    TriggerComment.jpg A "comment category" which you can use for "headlines" under (for example) categories so each trigger "group" is kept well organized.
    NewEvent.jpg Creates a new event for a trigger.
    NewCondition.jpg Creates a new condition for a trigger.
    NewAction.jpg Creates a new action for a trigger.


    Of course, you can just right-click on the list, a trigger or a category to create the above mentioned.

    RightClick.jpg
    [point]GUI (Graphical User Interface)[/point]
    GUI (Graphical User Interface)
    A graphical user interface, is a particular case of user interface for interacting with a computer which employs graphical images and widgets in addition to text to represent the information and actions available to the user.
    Usually the actions are performed through direct manipulation of the graphical elements.
    [point]Trigger Functions: "ECA" (Events, Conditions & Actions)[/point]
    Trigger Functions: "ECA" (Events, Conditions & Actions)

    [​IMG] Note; each individual trigger can be created using various of countless (describing many) methods.
    You will most likely come to discover that as you gain more experience.

    There are 3 "categories" of trigger functions (Events, Conditions & Actions):
    • Trigger Functions
      • Events
      • Conditions
      • Actions

    Notice, that these could be compared with the "cause and effect" theory. The cause and effect (Event and Action) with an optional "Condition" included.
    When the event(s) occur, all conditions are met, the action(s) will take place.

    Events.gif Events
    A trigger will start when any of the events listed occur.
    Note; you can "run" a trigger from another trigger without having those events occuring.

    Condition.gif Conditions
    Conditions are specific requirements which the trigger must observe.
    It cannot perform it's actions unless all the condition requirements have been covered.
    Note; that you can have 'And' / 'Or' conditions as well. Triggers that are run from another trigger have the option to ignore these conditions.

    Actions.gif Actions
    If the event occurs, all conditions have been met, then this is the action(s) that the trigger will perform.
    Note; that you can may 'Run' other triggers or turn other triggers OFF or ON as well.

    [​IMG] Note; You may put any new triggers in the original Melee Initialization category created by the world editor, but you are not obligated to.
    Categories have no influence on the functionality of the trigger, so it doesn't matter which order you put them in.

    Enable, Initially On & Trigger Comments
    Notice that there are 3 fields at the top of each trigger (highlight'ed below).
    TriggerFields.jpg
    • Enabled - Determines whether or not the trigger is enabled in your map. If 'disabled', the trigger has no function.
    • Initially On - Triggers can be turned ON and OFF. When checked, the trigger will initially be ON when the game begins.
    • Trigger Comment - Is a text field area where you can add any comments regarding the specific trigger. Keep in mind that it has no impact on functionality.
    [point]Trigger Examples[/point]
    Trigger Examples
    Below is shown some basic trigger samples.

    Opening A Gate #1 Events.gif Actions.gif
    In this example, I will demonstrate a way to open a Gate without any condition(s).
    Here's the trigger i'm using:
    • Gate
      • Events
        • Destructible - Lever 0039 <gen> dies
      • Conditions
      • Actions
        • Destructible - Open Gate (Horizontal) 0038 <gen>

    Gate.jpg

    Opening A Gate #2 Events.gif Condition.gif Actions.gif
    In this example, I shall demonstrate a way to open a Gate with a condition.
    Here's the trigger:
    • Gate
      • Events
        • Destructible - Lever 0039 <gen> dies
      • Conditions
        • (Owner of (Triggering unit)) Equal to Player 1 (Red)
      • Actions
        • Destructible - Open Gate (Horizontal) 0038 <gen>

    Gate2.jpg

    The Sunken Brigde Events.gif Condition.gif Actions.gif
    Here's the trigger i'm using for this demonstration:
    • Sunken Brigde
      • Events
        • Unit - A unit enters Region 000 <gen>
      • Conditions
        • (Owner of (Entering unit)) Equal to Player 1 (Red)
      • Actions
        • Destructible - Resurrect Short Natural Bridge (Vertical) 0000 <gen> with 2500.00 life and Show birth animation
        • Animation - Change Short Natural Bridge (Vertical) 0000 <gen>'s animation speed to 95.00% of its original speed
        • Trigger - Turn off (This trigger)

    showregion.jpg

    Brigde.jpg

    The Specific Key
    Coming soon...

    Links



    To be continued »
     
  2. adam067

    adam067

    Joined:
    Aug 23, 2007
    Messages:
    3
    Resources:
    0
    Resources:
    0
    hey ive just started war3 modding and i would rly like to now to to set a unit patrol on a target region because im been trying for ages.
     
  3. Archian

    Archian

    Site Director

    Joined:
    Jan 1, 2006
    Messages:
    2,902
    Resources:
    12
    Skins:
    1
    Tutorials:
    11
    Resources:
    12
    Try to ask your question here. And i guarantee you will get your question answered :)
     
  4. ringmaster

    ringmaster

    Joined:
    Dec 22, 2007
    Messages:
    4
    Resources:
    0
    Resources:
    0
    how do u get the lever?
     
  5. Herman

    Herman

    Joined:
    Aug 20, 2007
    Messages:
    877
    Resources:
    0
    Resources:
    0
    I like this

    This looks like it could be a tremendously great tutorial if it was continued

    I would also suggest adding in a little section on loops, how they work and what they do, but add that later, much later so players don't get overwhelmed
     
  6. x-calibur

    x-calibur

    Joined:
    Jan 9, 2007
    Messages:
    36
    Resources:
    0
    Resources:
    0
    this is maybe can help some users :D
     
  7. Aeroblyctos

    Aeroblyctos

    Joined:
    Aug 14, 2006
    Messages:
    6,597
    Resources:
    24
    Models:
    1
    Packs:
    1
    Maps:
    22
    Resources:
    24
    This is a simple, but very good tutorial. I like the pictures you have taken and good luck putting more stuff to this tutorial. This will also save much of my time, because now I don't need to show all n00b map makers how to do basic triggers. This tutorial explains it.

    Nice job, Archian.
     
  8. pistolwhip116

    pistolwhip116

    Joined:
    Sep 1, 2007
    Messages:
    8
    Resources:
    0
    Resources:
    0
    That helps alot (10/10)

    I just started trigger modding and i am amazed at how many things I can do with them

    World editor is one of the easiest-to-use editors I've ever used
    (UT04,Gmax,and EA command and conquer are the worst.)

    your tutorial is genius (for all the new modders)!!!
     
  9. Archian

    Archian

    Site Director

    Joined:
    Jan 1, 2006
    Messages:
    2,902
    Resources:
    12
    Skins:
    1
    Tutorials:
    11
    Resources:
    12
    Thank ye sir...
     
  10. ThE0RaVeN

    ThE0RaVeN

    Joined:
    Jan 3, 2008
    Messages:
    2
    Resources:
    0
    Resources:
    0
    yea how do i make my units look like they are walkin on the walls cuz i got some models and i have no idea how to make them walk on the models do i have to make a trigger to make them fly or somthing
     
  11. pistolwhip116

    pistolwhip116

    Joined:
    Sep 1, 2007
    Messages:
    8
    Resources:
    0
    Resources:
    0
    FIRST nice rep I feel loved =-)
     
  12. damurloc

    damurloc

    Joined:
    Aug 30, 2007
    Messages:
    23
    Resources:
    0
    Resources:
    0
    This is most helping, thank you oh repped one...

    Im very glad about this, since im kinda a newbie in triggers and other stuff... am good at terraining of course... ANYWAY just wanted to thank you... do something else now... don't keep reading... :slp:
     
  13. Archian

    Archian

    Site Director

    Joined:
    Jan 1, 2006
    Messages:
    2,902
    Resources:
    12
    Skins:
    1
    Tutorials:
    11
    Resources:
    12
    I made this tutorial long ago, might be of use to you.
    I think I posted it here at the Hive as well, but I'll redirect you to it here: http://www.wc3campaigns.net/showthread.php?t=85356

    Now any further questions should be posted in the World Editor Help Zone forum.
     
  14. Ostaph13

    Ostaph13

    Joined:
    Jun 27, 2008
    Messages:
    15
    Resources:
    1
    Tutorials:
    1
    Resources:
    1
    Good

    This is a good Tutorial for people who don't know triggering!
     
  15. ants376

    ants376

    Joined:
    May 25, 2008
    Messages:
    30
    Resources:
    0
    Resources:
    0
    i wanted to ask u something on the leader bords i needed one for ctf, and how to do a basic ctf if u can make aforem on that thatll be good
     
  16. Pompan

    Pompan

    Joined:
    Jan 4, 2009
    Messages:
    7
    Resources:
    0
    Resources:
    0
    Press the 'Object manager', then go to 'Destructibles', open the folder 'Trees/Destructibles' in there you can find the Lever. Right click it when you've fount it and click on 'Select in tool palette', now you can create levers!

    Hope this brings abit help to you! :smile:
     
  17. Pompan

    Pompan

    Joined:
    Jan 4, 2009
    Messages:
    7
    Resources:
    0
    Resources:
    0
    By the way, great help Archian!
    Opening a gate #1 and The sunken bridge, worked perfectly. But Opening a gate #2 didn't work out for me .. I wonder why :confused:
    Anyways, as I've already said great help! +rep :thumbs_up:
     
  18. XxHunterkillerxX

    XxHunterkillerxX

    Joined:
    Mar 24, 2009
    Messages:
    64
    Resources:
    0
    Resources:
    0
    Thanks for this tutorial! :D Love you! :)
    __________________
    [​IMG]
    "I am... XxHunterkillerxX, god of the galaxy Osore."
     
    Last edited: Apr 12, 2009
  19. naitsirk

    naitsirk

    Joined:
    Jan 24, 2009
    Messages:
    570
    Resources:
    0
    Resources:
    0
    This is realy helpfull for people like me:p but i don't get the Sunken bridge to work:(
     
  20. naitsirk

    naitsirk

    Joined:
    Jan 24, 2009
    Messages:
    570
    Resources:
    0
    Resources:
    0
    You have to put life to 0% of the bridge to make it work?? that was teh only way i got it to work...