[Classroom] GUI 101

PurgeandFire

zxcvmkgdfg
Reaction score
509
Sure! Damn... I must of deleted them from the attachment list by accident... Is it ok if it doesn't have them? But I might get the pictures back on soon. ;)

Thanks for notifying me of the issue. :D
 
A

A Fly

Guest
Well Purge, *laughs* it seems I am dropping my map projects for right now. So you can take me off of your class. :) Sorry, Thanks for the offer but I will not be working on it right now. :) <3 ttyl
 

PurgeandFire

zxcvmkgdfg
Reaction score
509
Allright then, it's ok. :eek:

I'll remove you off the list asap.

-Note:

- Next Lesson Should Start soon maybe tomorrow or even possibly today. Keep up the good work! :D
 

PurgeandFire

zxcvmkgdfg
Reaction score
509
If you're talking about homework, I think these are the people that did their homework:

  • rodead
  • hi_im_bob
  • pheonixashes
  • uareanoob
  • thedude ---------- Yes
  • MapMaker ---------- Yes
  • MaaxeEvid
  • Swish
  • ~GaLs~ ---------- Yes
  • denmax ---------- Yes
  • TheK1ll3r ---------- Yes
  • Newbwc3 ---------- Yes
  • THE_X
  • A Fly
  • Lanboy ---------- Yes
  • trigger_newb
The people that still need to do their homework are:
  • rodead
  • hi_im_bob
  • pheonixashes
  • uareanoob
  • MaaxeEvid
  • Swish
  • THE_X
  • trigger_newb

Good job to the people who did the tremendously easy homework (IMO). :D

If you're name was not mentioned, though you did your homework, please say so here. ;)
 

denmax

You can change this now in User CP.
Reaction score
155
Didn't A Fly requested to get taken of the list?
 

elmstfreddie

The Finglonger
Reaction score
203
Assignment 1 Difficulty: 0/10

LOL.
Sorry, just had to laugh.
Purge, if you want me to write any lessons PM me. Apparently EVERYONE wants to learn simple GUI, and NO ONE wants to learn advanced GUI :p
 

PurgeandFire

zxcvmkgdfg
Reaction score
509
Assignment 1 Difficulty: 0/10

LOL.
Sorry, just had to laugh.
Purge, if you want me to write any lessons PM me. Apparently EVERYONE wants to learn simple GUI, and NO ONE wants to learn advanced GUI :p

Lol... I gave them the answer in the text... You just needed to practically c'n'p a trigger made in 30 seconds. Lol..

Sure, I appreciate the help. Thank you! :D
 

elmstfreddie

The Finglonger
Reaction score
203
Lesson 2:​

- A simple text display trigger
- Variables
- Manipulating Variables
- Assignment

Well, 7 people did their post, and each was 100/100.

+rep to:
  • thedude
  • MapMaker
  • ~GaLs~
  • denmax
  • TheK1ll3r
  • Newbwc3
  • Lanboy



Simple Text Display Trigger:

Well, now that you understand and know how to create a trigger, we will go on to creating a simple text display trigger. This will display a text to all players for 5.00 seconds at map initialization. Seems easy huh? Well, yes it is:
Code:
Events Map Initialization Conditions Actions Game - Display "This is lesson 2" for (All Players) over 5.00 seconds //Trigger might not be exact//

This will simply display the text "This is lesson 2".
Challenge 1:
------------------
Create a trigger at map initialization that reads "Poopoo" for All players over 20.00 seconds
------------------

Variables:


Variables are simple things that contain a value in them. A variable is also a math term, but both terms are related; they both store values.
Math Variable
x = 4

Warcraft Variable
set x = 4

For both variables, if you do x + 4, it will equal 8.

Though warcraft variables do not contain only integer values, it can contain boolean values, player values, image values, even ubersplat values. To create a variable, open the variable editor (Sign with a big "X" in the trigger editor) (CTRL + B is the hotkey I think) then click the big "+X" button to create it. It should show you a menu of options:

Name:

This will be the name of the variable, make sure it is relevant to its value.
-by PurgeandFire

Type:
As implied, this is the type of variable. Unlike some real programming languages, each variable can only be set to what type it is. The names are pretty self-explanitory.

Array:
A check box, that once checked you can edit the box with numbers. Arrays are pretty much like having different variables, except they are all held under one name. For example, you could have two integer variables. Integer1 and Integer2. Or, you could have a variable with an array of 2, Integer[1] and Integer[2]. This makes it easier to have multiple variables of 1 type.

Manipulating Variables:
Manipulation capabilities of a variable will depend on the type of variable, for instance an integer can be mathimified, and a unit can... Be a unit.
To manipulate a variable, we use the action General - Set Variable.
One bad thing about manipulating a real/integer variable, is that you cannot just add a number to it. You have to set the variable = variable + what you want.
Variables can be used for various things. For example, in a trigger with the event A unit dies, if you use a wait, after that wait there will be no such thing as Dying Unit and no such thing as Killing Unit. So, you could, before the wait, set a variable to equal Dying Unit or Killing Unit, or both, then referring to them after the wait.
Variables can also be used for making your life easier when triggering. Lets say you're making a triggered ability, it would be a pain to every time put (100.00 + (Level of Acid Bomb for (Triggering unit)) * 50.00). So, you could set an integer variable to = (100.00 + (Level of Acid Bomb for (Triggering unit)) * 50.00), then refer to that variable.

Important: To refer to a variable inside an action, instead of choosing function, you select variable, and find your variable in the variables list.

Assignment: Difficulty: 2/10
Make a trigger which uses variables to display 2 different messages to player 1. Set a text variable (which are called strings) to Poopy Face, and a different variable to I am a, and display them in opposite order.
(If that sounds confusing, I mean set String1 then String2, then display String2 then String1)
<<Bonus marks for doing a hidden task>>
-by elmstfreddie
 

PurgeandFire

zxcvmkgdfg
Reaction score
509
Thanks elmstfreddie for finishing that up. Yes, I asked him to finish it up, I just didn't have the time at the moment. Anyways, it looks great and well written, though the code for the trigger is all jacked up. lol... ;)

Don't forget to do the challenge and please do the homework!

Thank you!
 

~GaLs~

† Ғσſ ŧħə ѕαĸε Φƒ ~Ğ䣚~ †
Reaction score
180
Actually i am not so understand wat is the assignment want me to do...but i will do a trigger here see if it is correct.

Code:
Challenge 1
    Events
        Map initialization
    Conditions
    Actions
        Game - Display to (All players) for 20.00 seconds the text: Poopoo

Code:
Assignment
    Events
        Map initialization
    Conditions
    Actions
        Set String1[1] = |CFFFF0000P|CFFFF5500o|CFFFFFF00o|CFFAAFF00p|CFF55FF00y |CFF00AA55F|CFF0000FFa|CFF552AFFc|CFFAA55FFe
        Set String2[2] = |CFFFF0000I |CFF80FF00a|CFF00FF00m |CFF7F40FFa 
        Game - Display to (All players) the text: String1[1]
        Game - Display to (All players) the text: String2[2]
        Game - Display to (All players) the text: (String2[2] + String1[1])
 

denmax

You can change this now in User CP.
Reaction score
155
Code:
Challenge 1
    Events
        Map Initialization
    Conditions
    Actions
        Game - Display to (All Players) text: Poopoo

Code:
Challenge 1 [MUI]
    Events
        Time - Every 1 second of the game
    Conditions
    Actions
        Custom script: local string PoopooString
        Set PoopooString = Poopoo
        Game - Display to (All Players) text: PoopooString

Code:
Assignment 2
    Events
        Map Initialization
    Conditions
    Actions
        Set String[1] =  Poopy Face.
        Set String[2] = I am a
        Game - Display to Player 1 (Red) text: (String[2] + String[1])

Remember that I placed a space before Poopy Face. to separate the Strings.

Code:
Assignment 2 [MUI]
    Events
        Time - Every 1 seconds of the game
    Conditions
    Actions
        Custom script: local string String
        Set String[1] =  Poopy Face.
        Set String[2] = I am a
        Game - Display to Player 1 (Red) text: (String[2] + String[1])

Well, I think this doesn't work but I can't think of anything, Global Locals are only set in one trigger..

Originally posted by elmstfreddie
<<Bonus marks for doing a hidden task>>

The hidden task can be
1. MUI
2. Removing/Destroying the String after use (which I don't know how)
3. Using the Array
4. Doing the challenge
5. Placing space before String[1] or after String[2]


^_^

EDIT: Removed Custom script Actions..
 
T

TheK1ll3r

Guest
Assignment and challenge:
Code:
Challenge1
    Events
        Map initialization
    Conditions
    Actions
        Game - Display to (All players) for 20.00 seconds the text: PooPoo

Code:
Assignment
    Events
        Map initialization
    Conditions
    Actions
        Set String1[1] = Poopy Face
        Set String2[2] = I'm a
        Game - Display to (All players) the text: String1[1]
        Game - Display to (All players) the text: String2[2]
        Game - Display to (All players) the text: (String2[2] + String1[1])
I hope it's OK -.-
 
M

MapMaker

Guest
Since my internet and warcraft computers are both seperate, i will have to manually do my hw, by typing,

challenge:
Event- Map initialazion
condition-
Action- Display to (all players) for 20 sec the text: poopooface

now the assignment

Event-map initialation
Condition-
Action- Set String1[1] = Billy is da man
Set String2[2] = Billy is da man
Game - Display to (All players) the text: String1[1]
Game - Display to (All players) the text: String2[2]
Game - Display to (All players) the text: (String2[2] + String1[1])
 

elmstfreddie

The Finglonger
Reaction score
203
Yo purgeandfire, I'm giving out the marks for assignment 2 since I made it, ok?

Again, if you need my help I'm always here.
 
General chit-chat
Help Users
  • No one is chatting at the moment.

      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