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. The reforging of the races is complete. Come see the 14th Techtree Contest Results.
    Dismiss Notice
  4. It's time to choose your horse in the race - the 32nd Modeling Contest Poll is up!
    Dismiss Notice
  5. 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.

Starting with GUI

Discussion in 'Trigger (GUI) Editor Tutorials' started by Lord_of_sausage, Mar 21, 2008.

  1. Lord_of_sausage

    Lord_of_sausage

    Joined:
    Aug 18, 2007
    Messages:
    1,355
    Resources:
    4
    Maps:
    3
    Tutorials:
    1
    Resources:
    4
    Welcome
    Hi all, i saw alot of people asking for this, so i'd made a tutorial of it.

    Getting Started
    Triggers looks advanced on first look, ill remmember my first try, wich spawned a peon every second on the map, where it should only spawn one :)
    But away from that, i'll introduce you.

    Each trigger is divided into 3 parts, Events, Conditions and Actions

    Events is WHEN the trigger is excecuted, when the trigger happens
    Conditions is what NEEDs to be fullfilled before the actions takes place
    Actions is WHAT happens

    All Actions, Events and Conditions does excactly what they say, like the action called Unit - Kill, kills a unit :eekani:
    That makes sence right?

    I will guide you through a simple spawn trigger, then youre on your own!
    I want this trigger, to create 3 Peasants at the middle of my map, when a Paladin enters a "region"

    Makeing the "region"

    First, ill make a region:
    1: Click "R" when you're watching your terrain.
    2: This will popup: Tutorial2.jpg
    3: Click this button wich means "Create Region"
    4: Pull out an area on the terrain, like when selecting multiple units ingame.
    5: Go rename the region by Right clicking the region name and choose "Rename Region" or "Region Properties"
    Now type in Spawn 3 peasants

    Now, we got a Region called "Spawn 3 peasants". This is the region we want to have the paladin enter, for spawning some peasants.

    We want to make the trigger now, so open the trigger editor, looking like an "A"
    Now click the piece of paper, wich got a BOLD frame.

    Event, Condition and Action

    Now lets make the trigger:
    1: Click the Event icon, it looks like a red flag.
    2: Find the text called Unit - Unit enters Region
    3: You see that Region is red, thats because "Region" is invalid. Click the red text, and under "Varibles" you'll see the Spawn 3 Peasants region!
    4: Click the Spawn 3 peasants region, and press "OK"
    5: Click "OK" again, as our Event is done! HOORAY!

    Now, we need a condition, to tell that we only want it to spawn when its a Paladin who enters.

    So, Click the Condition icon, looking like a piece of paper with a green arrow on.
    1: Find the text called Unit - type comparison
    2: Click the text "Footman" and click the icon of the paladin
    3: Press "OK" twice.

    (The text wich says "Triggering Unit" means that its the unit were talking about in the event, we could change it to "Entering unit", but right here its unneseary. If we would like to make a trigger wich created a unit for a plyaer, when his unit dies, and kills the unit who attacked, we would have to use "Killing unit" and "Dying Unit" as the event only talks about one of them.)

    Now lets make our Action. Press the Action icon, it looks like one of thoose funny movie things.
    1: Find the text Unit - Create units facing angle
    2: Footman is'ent the unit we want, so click the text, and then the icon of a peasant.
    3 now, we would like 3, not one, so click the text "1" and type in "3" instead. Notice that thoose 3 is spawned at the same point!
    4: Press ok twice.


    DONE!

    Voila, were done!
    it should look like this: Tutorial1.jpg

    When a paladin enters our region, the map creates a unit at the "center of playable map area" wich is the middle of our map.
    Thats all from me, if you wonna test the trigger, place a paladin using the Unitpalette, wich can be assced by pressing "U" when looking at the terrain
    or by clicking the drop menu at the region pallete and click "Unit".

    //Lord_of_Sausage
     
    Last edited: Mar 21, 2008
  2. redmarine

    redmarine

    Joined:
    Sep 4, 2007
    Messages:
    2,781
    Resources:
    1
    Maps:
    1
    Resources:
    1
    Shouldn't you replace triggering unit with entering unit to make it easier for people to understand? Maybe it is just me.
     
  3. Lord_of_sausage

    Lord_of_sausage

    Joined:
    Aug 18, 2007
    Messages:
    1,355
    Resources:
    4
    Maps:
    3
    Tutorials:
    1
    Resources:
    4
    hmm, you can be right, i'll go edit it abit.
     
  4. GhostWolf

    GhostWolf

    Joined:
    Jul 29, 2007
    Messages:
    4,875
    Resources:
    2
    Tools:
    1
    Tutorials:
    1
    Resources:
    2
    Looks good and usefull. Maybe add a bit of colors and some more examples.
    Would also be nice if you add the pic of the trigger editor button.

    Beside that, please add a section on variables :p
     
  5. Lord_of_sausage

    Lord_of_sausage

    Joined:
    Aug 18, 2007
    Messages:
    1,355
    Resources:
    4
    Maps:
    3
    Tutorials:
    1
    Resources:
    4
    Variables? aint they a little more advanced? Or is it just me who found out what i could with them after i made maps for a half year? :D
    well, i might come up with that, but not yet, i will also add screenies of the different buttons.

    Also thanks for rep :D (just noticed ;D)
     
  6. underscore

    underscore

    Joined:
    Mar 17, 2008
    Messages:
    150
    Resources:
    0
    Resources:
    0
    GhostWolf is right

    Yep, Variables are just easy when you understand them a bit. =0
     
  7. Lord_of_sausage

    Lord_of_sausage

    Joined:
    Aug 18, 2007
    Messages:
    1,355
    Resources:
    4
    Maps:
    3
    Tutorials:
    1
    Resources:
    4
    Yea, i were just slow :p
     
  8. Narasha

    Narasha

    Joined:
    Feb 25, 2016
    Messages:
    13
    Resources:
    0
    Resources:
    0
    I think using Triggering Unit is much faster than the Entering Unit
     
  9. Ragnar9

    Ragnar9

    Joined:
    Jan 15, 2018
    Messages:
    94
    Resources:
    0
    Resources:
    0
    This is great, exactly the kind of thing im looking for as a beginner.

    Could you do one where unit enters region and buildings spawn?
    - ive seen it before where they come out of nowhere, and also where they are invulnerable and then change when the unit enters or when the research is completed.