Tutorial GUI Let's Break It Down.

Radiance

New Member
Reaction score
1
Okay so today I'm going to explain the basics of GUI. This tutorial is very basic and if you know what events actions and conditions are then this is not the tutorial for you. I know lots of people out there won't need this tutorial but when I started out boy was I confused, so lets hope this helps those who are beginning. Lets begin...

1. Basic Structure Of A GUI Trigger.

2. Diving Into Conditions


1. GUI The Basic Structure:
A GUI trigger consists of three types of lines. An event, a condition, and an action.

Events: An event is an action, or event that must occur before running the action. An example would be the one i listed below. All it says is 'a unit dies'.
So the event is 'a unit dies'. Simple enough? I hope so.

Trigger:
  • Events
    • Unit - A unit Dies


Conditions: A condition is the requirement that must be met before the action is ran. That may or may not sound complicated but let me explain. Our event is 'A unit Dies'. But we ask what unit? If you want to specify the type of unit you use the condition. (Don't worry I will go more into detail about why we are specifying the unit later.)

Adding The Condition:
So now lets right click Condition. And choose add condition. Now scroll down to Unit-Type Comparison.
Now change the triggering unit in Unit Type Of Triggering Unit. Change it to dying unit, because our event is 'A unit dies'. Now just click ok because we are using footman as our unit today.

Review:
Okay so right now our trigger should currently look like this.

Trigger:
  • Events
    • Unit - A unit Dies
    • Conditions
      • (Unit-type of (Dying unit)) Equal to Footman
    • Actions


All this means is 'A unit dies'. The type of dying unit is a footman, and only a footman. Read it over until you understand what this means so far. Now to the toughest part of a trigger.

Sidenote: You can specify one specific unit with Unit Comparison. Because the unit type comparison, is specifying all units of the type footmen instead of one specific footmen.

Actions:
What are actions? Actions are the actions that will occur after the event has occured and the conditions are met. An example would be

Trigger:
  • Events
    • Unit - A unit Dies
    • Conditions
      • (Unit-type of (Dying unit)) Equal to Footman
    • Actions
      • Game - Display to (All players) the text: A footman has been slain.


So here, A unit has died. Hey look it's a footman, it matches the condition. And now the action will run, which is to Display a text to all players. The text will be A footmen has been slain.

That is pretty much it for the basic structure of a GUI trigger, and I have posted up 2 other simple GUI triggers so you can use them as examples.
*Rememeber, Events is what is to happen, conditions is a requirement that the event must meet, and the action is what happens after all is met. Explore the Events , Conditions, and Actions and get familiar with what you can do.

------------------------------------------------------------------------------------------------------------------------------------

Trigger:
  • Events
    • Unit - A unit enters Region 000 <gen>
    • Conditions
      • (Unit-type of (Entering unit)) Equal to Knight
    • Actions
      • Unit - Move (Entering unit) instantly to (Center of (Playable map area))


All this says is that a unit enters a region. Then the unit type of the entering unit has to be a knight or else it won't run the action. And the action is to Move the knight that has entered to the center of the map.

I will explain what a Region is, and they're uses later on in this tutorial.

*These triggers all leak, and I'm not covering leaks today but if you want to learn more a good tutorial would be emijrl's. I'll post it at the end of the tutorial.

----------------------------------------------------------------------------------------------


Diving Into Conditions: As i was starting out I never realized how many type of conditions there were and what they all did. So in this tutorial I also going to go a little deeper into conditions. I won't go over all the conditions just the more common ones.

Conditions And What They Do:
Boolean Comparison: The boolean comparison is used often because of it's large arrays of conditions. It is usually used to detect stuff. Like buffs, whether a unit is alive or dead, or the level of an ability for a unit.

Ability Comparison: This condition is one of the easiest, all it does is detect the spell that is being cast or channeled. Useful for trigger enhancing spells.

Integer Comparison: This one is an important one. You use it when you want to compare in integers or numbers. For example. Pay attention to the event, and conditions.
Trigger:
  • Events
    • Unit - A unit Begins casting an ability
    • Conditions
      • (Level of (Ability being cast) for (Casting unit)) Equal to 3
    • Actions
      • Special Effect - Create a special effect at (Position of (Casting unit)) using Abilities\Spells\Human\ThunderClap\ThunderClapCaster.mdl


A unit casts an ability. Simple. Now the level of the ability has to be 3 in order to run the action. So if it has to do numbers go for the integer comparison.

Unit Type Comparison: As you have learned about earlier in this tutorial the Unit type condition is useful for several things. It specifies a group of units of the same type. Like footmen, or wolves.

Multiple Conditions/Rules and Uses:

Sometimes you will have to use several conditions or an 'or condition.' Here I will explain how to use multiple conditions.

Now right click conditions in a new trigger. Then select add condition. Scroll all the way down till you see Or,Multiple Conditions. This is used when you the action can be ran when one of the conditions have been met.

Trigger:
  • Wrong:
    • <div class="bbCodeBlock bbCodeBlock--screenLimited bbCodeBlock--code"><div class="bbCodeBlock-title">Trigger:</div><div class="wc3trigger"><ul class="wc3" id="wc3_6">
    • <li class="lastopen"><span class="events">Events</span>
    • <ul>
    • <li class="tree"><span class="unit">Unit - A unit Dies</span></li>
    • <li class="open"><span class="conditions">Conditions</span>
    • <ul>
    • <li class="tree"><span class="default">(Unit-type of (Dying unit)) Equal to Mountain King</span></li>
    • <li class="lasttree"><span class="default">(Unit-type of (Dying unit)) Equal to Archmage</span></li>
    • </ul>
    • </li>
    • <li class="lastopen"><span class="actions">Actions</span>
    • <ul>
    • <li class="lasttree"><span class="hero">Hero - Instantly revive (Dying unit) at (Center of (Playable map area)), Show revival graphics</span></li>
    • </ul>
    • </li>
    • </ul>
    • </li>
    • </ul>
    • </div></div>


What the conditions are saying is that both the heroes have to die at the same time in order for the Actions to be run.

Correct:
Trigger:
  • Events
    • Unit - A unit Dies
    • Conditions
      • Or - Any (Conditions) are true
        • Conditions
          • (Unit-type of (Dying unit)) Equal to Archmage
          • (Unit-type of (Dying unit)) Equal to Mountain King
    • Actions
      • Hero - Instantly revive (Dying unit) at (Center of (Playable map area)), Show revival graphics



Now this is correct because the Or-Any(Conditions) are true makes the trigger says: If an archmage dies he will be revived , or if a mountain king dies he will be revived. The actions will run as long as one of the conditions are met.




------------------------------------------------------------------------------------------------------------------------------------

Thank You For Those Who Read. I hoped I helped all those beginners out there who needed help and was lost, confused, yet fascinated when you first opened World Editor. Remember explore the trigger editor and get familiar

The best way is to create some sample triggers, basic ones. You can use the triggers I have used in this tutorial and change them a little bit. I advise you not to start a map until you completely understand this tutorial and more because this is a very basic tutorial.

(If you are having trouble with a GUI trigger then I ask here then I may be able to help you)

Leak Tutorial: http://www.thehelper.net/forums/showthread.php?t=27219&highlight=Leaks

*Srry If I spelled your name wrong above.

I would appreciate feedback and constuctive criticism on how to make this tutorial better. Comments would be appreciated as well.

~Radiance
 

Gtam

Lerning how to write and read!! Yeah.
Reaction score
164
there is already a tut that explains all this and more
 

Rainther

I guess I should write something of value here...
Reaction score
61
It's the work of the devil! :D

Nah, kidding. GUI is a good thingie to start with I guess.
As you mentioned it's basic, you haven't mentioned stuff like Last Created and Loop, but it seems good at first look.
 

GetTriggerUnit-

DogEntrepreneur
Reaction score
129
The green killed my eyes :(, now they don't stop to bleed!! You'll receive a letter from my lawyer! :thup:
 

Romek

Super Moderator
Reaction score
963
Start off by removing the Lime colour, and replacing it with ordinary Green.

I don't have anything against having multiple GUI starter tutorials. In fact, we already have multiple JASS tutorials, all written slightly differently from different angles.
 
General chit-chat
Help Users
  • No one is chatting at the moment.
  • The Helper The Helper:
    So what it really is me trying to implement some kind of better site navigation not change the whole theme of the site
  • Varine Varine:
    How can you tell the difference between real traffic and indexing or AI generation bots?
  • The Helper The Helper:
    The bots will show up as users online in the forum software but they do not show up in my stats tracking. I am sure there are bots in the stats but the way alot of the bots treat the site do not show up on the stats
  • Varine Varine:
    I want to build a filtration system for my 3d printer, and that shit is so much more complicated than I thought it would be
  • Varine Varine:
    Apparently ABS emits styrene particulates which can be like .2 micrometers, which idk if the VOC detectors I have can even catch that
  • Varine Varine:
    Anyway I need to get some of those sensors and two air pressure sensors installed before an after the filters, which I need to figure out how to calculate the necessary pressure for and I have yet to find anything that tells me how to actually do that, just the cfm ratings
  • Varine Varine:
    And then I have to set up an arduino board to read those sensors, which I also don't know very much about but I have a whole bunch of crash course things for that
  • Varine Varine:
    These sensors are also a lot more than I thought they would be. Like 5 to 10 each, idk why but I assumed they would be like 2 dollars
  • Varine Varine:
    Another issue I'm learning is that a lot of the air quality sensors don't work at very high ambient temperatures. I'm planning on heating this enclosure to like 60C or so, and that's the upper limit of their functionality
  • Varine Varine:
    Although I don't know if I need to actually actively heat it or just let the plate and hotend bring the ambient temp to whatever it will, but even then I need to figure out an exfiltration for hot air. I think I kind of know what to do but it's still fucking confusing
  • The Helper The Helper:
    Maybe you could find some of that information from AC tech - like how they detect freon and such
  • Varine Varine:
    That's mostly what I've been looking at
  • Varine Varine:
    I don't think I'm dealing with quite the same pressures though, at the very least its a significantly smaller system. For the time being I'm just going to put together a quick scrubby box though and hope it works good enough to not make my house toxic
  • Varine Varine:
    I mean I don't use this enough to pose any significant danger I don't think, but I would still rather not be throwing styrene all over the air
  • The Helper The Helper:
    New dessert added to recipes Southern Pecan Praline Cake https://www.thehelper.net/threads/recipe-southern-pecan-praline-cake.193555/
  • The Helper The Helper:
    Another bot invasion 493 members online most of them bots that do not show up on stats
  • Varine Varine:
    I'm looking at a solid 378 guests, but 3 members. Of which two are me and VSNES. The third is unlisted, which makes me think its a ghost.
    +1
  • The Helper The Helper:
    Some members choose invisibility mode
    +1
  • The Helper The Helper:
    I bitch about Xenforo sometimes but it really is full featured you just have to really know what you are doing to get the most out of it.
  • The Helper The Helper:
    It is just not easy to fix styles and customize but it definitely can be done
  • The Helper The Helper:
    I do know this - xenforo dropped the ball by not keeping the vbulletin reputation comments as a feature. The loss of the Reputation comments data when we switched to Xenforo really was the death knell for the site when it came to all the users that left. I know I missed it so much and I got way less interested in the site when that feature was gone and I run the site.
  • Blackveiled Blackveiled:
    People love rep, lol
    +1
  • The Helper The Helper:
    The recipe today is Sloppy Joe Casserole - one of my faves LOL https://www.thehelper.net/threads/sloppy-joe-casserole-with-manwich.193585/

      The Helper Discord

      Staff online

      Members online

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top