[Classroom] GUI 101

PurgeandFire

zxcvmkgdfg
Reaction score
509
@thedude: Denmax revealed with his white text, just highlight it with your mouse. :)

People that did their homework so far:

  • ~GaLs~
  • denmax
  • TheK1ll3r
  • MapMaker
  • thedude [1/2 of the Homework(Forgot the Challenge)]

Thank you! It was just a quick update and informational list of who did their homework so far. :D
 
T

thedude

Guest
@thedude: Denmax revealed with his white text, just highlight it with your mouse. :)

People that did their homework so far:

  • ~GaLs~
  • denmax
  • TheK1ll3r
  • MapMaker
  • thedude [1/2 of the Homework(Forgot the Challenge)]

Thank you! It was just a quick update and informational list of who did their homework so far. :D

Game - Display to (All players) for 20.00 seconds the text: Not PooPoo

Edit: Sorry i should have edited mine...

Wouldn't a challenge be considered optional? It wasn't in the assignment part.
 

PurgeandFire

zxcvmkgdfg
Reaction score
509
Game - Display to (All players) for 20.00 seconds the text: Not PooPoo

Edit: Sorry i should have edited mine...

Wouldn't a challenge be considered optional? It wasn't in the assignment part.

Lol... I just want them to do that because it means that you kinda actually read/skimmed over the thread not just did the assignment.

Hm... @Elmstfreddie:
Leet Language so That it is like a private discussion:
¡ § 7 |-| @ 7 9 0 0 þ € |\| 0 µ 9 |-| , 0 |2 þ 0 € § 7 |-| € þ µ þ € |\| € € þ 7 0 p µ 7 7 |-| € \/\/ |-| 0 £ € € |\| 7 1 |2 € 7 |2 ¡ 9 9 € |2 ? £ ¤ £
 

elmstfreddie

The Finglonger
Reaction score
203
Uhm, I can't read some of that. What is 9 = ?
Normally when I write leet I put spaces between letters, and double spaces between words. Makes it semi-readable ;)
My name = '][' |2 [- \/ ( ) |2
oh snap?
 

elmstfreddie

The Finglonger
Reaction score
203
Yes, it does seem harder to read now, but I actually managed to make out more than before.
I got pretty far in then I started reading stuff like
TIROUAG so I was like, wtf.

WE ARE GETTING OFFTOPIC ON YOUR OWN THREAD >_>
 

PurgeandFire

zxcvmkgdfg
Reaction score
509
¡ § 7 |-| @ 7 9 0 0 þ € |\| 0 µ 9 |-| , 0 |2 þ 0 € § 7 |-| € þ µ þ € |\| € € þ 7 0 p µ 7 7 |-| € \/\/ |-| 0 £ € € |\| 7 1 |2 € 7 |2 ¡ 9 9 € |2 ? £ ¤ £

Translation:
Is that good enough, or does thedude need to put the whole entire trigger? lol

That's is what is says in English.

Learn your leet language mister! :D
 

PurgeandFire

zxcvmkgdfg
Reaction score
509
I know, I double spaced but it didn't show up very well.

Anyways, this is getting off topic.

nc-offtopic.gif
 

PurgeandFire

zxcvmkgdfg
Reaction score
509
Elmstfreddie should give the rep and announce the people that got 100/100.

Note that elmstfreddie will only give rep to the 100/100 people. :)

Anyways, here is the next lesson:

Lesson Plan:
  • Generals:
    • Custom Scripts
    • Setting Variables
    • Integer Loops
    • If/Then/Elses
  • Challenges
  • Assignment

Lesson 3:

Custom Scripts:

What are custom scripts?

A Custom Script is an action in GUI that allows you to easily utilize the powers of JASS. Don't be scared however; when using GUI custom script is usually only used to remove leaks. JASS is not what we are talking about though, but JASS has things that GUI can't perform, such as removing leaks from locations, unit groups, regions, and player groups.

To access the custom script function, go to:
Actions | General | Custom Script

Then click the value. After that, type what you want to remove the leak.

NOTE: The leak must be set to a variable such as:

Code:
    Set UG = Units in (Playable Map Area)    
    Unit Group - Pick every unit in (UG) and do (Actions)

Then you can destroy it.

Locations:

A really common leak, just do this to fix it:
Code:
Custom Script:    call RemoveLocation(udg_VarName)

Unit Groups:

A really common leak as well, just do this to fix it:
Code:
Custom Script:    call DestroyGroup(udg_VarName)

If you don't want to set the group to a variable, an easy way to prevent the leak it to do this:
Code:
    Custom Script:    set bj_wantDestroyGroup = true
    Unit Group - Pick every unit in (Units In (Playable Map Area)) and do (Actions)

This prevents the leak as well.

Regions:

Regions are usually real minor leaks. When creating leaks such as:
Code:
    Set Region = (Point) with size 700,700

Then that leaks, so you must do this:
Code:
Custom Script:    call RemoveRect(udg_Region)

Player Groups:

These don't happen often, but it is good to clean them up when you use them. ^^

Just simply do this:
Code:
Custom Script:    call DestroyForce(udg_VarName)

Setting Variables:

As mentioned in the great tutorial before, variables have a certain format:
Set VarName = VarValue

To do this, go to Actions | General | Set Variable. If you do not understand this, then I strongly suggest reading the previous tutorial by elmstfreddie.

Integer Loops:


Integer loops are fantastic functions that can shorten up many triggers. The integer loops look like this:
Code:
For Each (Integer X) from Y to Z, do (Actions)

It is a simple function.

Integer X = Either Integer A or B
Y = Starting Value
X = Ending Value

So if you did this:
Code:
set Ability[1] = Level of (Acid Bomb) for Triggering Unit
set Ability[2] = Level of (Acid Bomb) for Triggering Unit
set Ability[3] = Level of (Acid Bomb) for Triggering Unit
set Ability[4] = Level of (Acid Bomb) for Triggering Unit
set Ability[5] = Level of (Acid Bomb) for Triggering Unit

You could simply do this instead:
Code:
For Each (Integer A) from 1 to 5 do (Actions)
    Loop Actions
        set Ability[IntegerA] = Level of (Acid Bomb) for Triggering Unit

This will loop from 1 to 5 setting the variables, so it would do this:
Code:
1st loop
    set Ability[1] = Level of (Acid Bomb) for Triggering Unit
Code:
2nd Loop
    set Ability[2] = Level of (Acid Bomb) for Triggering Unit

... etc.

This will set the loops and avoid the long trigger.

If/Then/Elses:
If/Then/Elses are like any regular if/then/else statement.

In hypotheses, you usually do them in this format, well sometimes:
Code:
[B]If[/B] the ogre is fat, [B]then[/B] the ogre will fall.

This, though, is a prediction. We, instead, are going to tell what happens.

So, that means that an "if" is a condition, a "then" contains the actions that you will do if the condition is true, and an "else" is what else you would do.

Here is an example:
Code:
If (All Conditions) are true, then do (Then Actions) else do (Else Actions)
    If - Conditions
        (Level of (Acid Bomb) for (Triggering Unit)) Equal to 3
    Then - Actions
        Unit - Explode (Triggering Unit)
    Else - Actions
        Unit - Kill (Triggering Unit)

This means that if the ability for the triggering unit is level 3, then the unit will be exploded. If the "If" is false though, then the unit will be killed.

Do NOT put "Do Nothing" in your else actions because it is a pointless function.

I think that is all you need to know, I hope this helps!

Challenges:
  • Destroy a group called "PoopG"
  • Remove a location called "PoopL"
  • Set a unit variable called "Pooper" as the triggering unit
  • Set a location variable called "PooperL" as the triggering unit's location and remove the leak.
  • Create a loop that destroys a special effect array from 1 to 10
  • Create an if/then/else that makes it so that if the triggering unit's ability (Acid Bomb) is on level 7, then kill the unit else do nothing. (Trick Question)

Assignment:

Create a units variable called "Pooper" as the triggering unit.

Set a unit group variable as the units within 500 range of the pooper.

Set an effect array called "PoopFX" from 1-10 as the last created special effect.

Then get the poopers location (position of pooper).

Then create an if/then/else that checks if the unit's ability (war stomp) is on level 3 then explodes the unit else displays a text for 2.00 seconds reading "Your Level is not 3".

Then destroy the effect array from 1-10.

Finally, remove the rest of the leaks.

Difficulty:

4/10

Enjoy! :D

Please turn in your homework. ^^
 

elmstfreddie

The Finglonger
Reaction score
203
I do?
Well, I gave rep to everyone that did their homework really... :rolleyes:
But the people who didn't get 100 were minor errors, attempting to get at my "secret" I assume.
I deleted all my PMs (sent and received I had like 42/50 in my space), so I'll have to go back and look >_<

>Custom Scripts are GUI functions that allow you to use JASS functions within them. JASS is not what we are talking about though

Well, no.
We ARE talking about JASS. Custom Script is not a GUI function that always you to use JASS functions. It's just using a function from JASS in GUI.
It should read..
Custom Script is an action that is not in GUI, because even when using GUI it is necessary to have some JASS in it. JASS can perform some things JASS can't, like leak removal. There are a few JASS functions that are mandatory to know in GUI.
Or something similar.
Oh yeah, and list what leaks and what doesn't. You mentioned some things, but it's also a good idea to add in Things that are recognized as letters or numbers will not leak. The only exception is units and abilities. The reason this is, because World Editor thinks of units and abilities as integers.
Then again, don't confuse them... ;)

Edit
denmax and thedude got 105, the rest got 95.
 

PurgeandFire

zxcvmkgdfg
Reaction score
509
Updated, thanx elmst. Anyways, I should delete all of my pms as well. ^^

Note: I might not have too much time to view this thread itself, but I will be under constant watch. The reason why is because I'm actually trying to create 3D models. :p

Look mah! I made a pumpkin thingy! :D
View attachment 9159
 

elmstfreddie

The Finglonger
Reaction score
203
Remove your nots in the intro, and it's fine!
...
Oops, I meant it is. Sorry, typed what I said really fast with a headache. Try..
Custom Script is an action in GUI that allows you to easily utilize the powers of JASS. Don't be scared however; when using GUI custom script is usually only used to remove leaks.

Heh... That's more accurate. Sorry for the confusion >_<
 

denmax

You can change this now in User CP.
Reaction score
155
Challenges:

* Destroy a group called "PoopG"
* Remove a location called "PoopL"
* Set a unit variable called "Pooper" as the triggering unit
* Set a location variable called "PooperL" as the triggering unit's location and remove the leak.
* Create a loop that destroys a special effect array from 1 to 10
* Create an if/then/else that makes it so that if the triggering unit's ability (Acid Bomb) is on level 7, then kill the unit else do nothing. (Trick Question)


Assignment:

Create a units variable called "Pooper" as the triggering unit.
Set a unit group variable as the units within 500 range of the pooper.
Set an effect array called "PoopFX" from 1-10 as the last created special effect.
Then get the poopers location (position of pooper).
Then create an if/then/else that checks if the unit's ability (war stomp) is on level 3 then explodes the unit else displays a text for 2.00 seconds reading "Your Level is not 3".
Then destroy the effect array from 1-10.
Finally, remove the rest of the leaks.

Code:
Challenge
    Events
        Unit - A unit Starts the effect of an ability
    Conditions
        (Ability being cast) Equal to Acid Bomb
    Actions
        Set Pooper = (Casting Unit)
        Set Poop = (Target unit of ability being cast)
        Set PooperL = (Position of Pooper)
        Set PoopL = (Position of PoopL)
        Set PoopG = (Units within 500 of PoopL matching (((Matching Unit) is alive) Equal to True) and (((Matching Unit) belongs to an enemy of Pooper) Equal to True) 
        For each (Integer A) from 1 to 10 and do (Actions)
            Loop - Actions
                Unit Group - Pick every unit in PoopG and do Actions
                    Loop - Actions
                        Special Effect - Create a [..] special effect on chest of (Picked Unit)
                        Set PoopFX[Integer A] = (Last Created Special Effect)
                        Special Effect - Destroy PoopSFX[Integer A]
        If ((Level of Acid Bomb for Pooper) Equal to 7) then do (Unit - Cause Pooper to damage Poop for 99999999.00 damage at attack type Chaos damage type Normal) else do (Do Nothing)
        Custom script: call RemoveLocation(udg_PooperL)
        Custom script: call RemoveLocation(udg_PoopL)
        Custom script: call DestroyGroup(udg_PoopG)
I didn't understand the instructions on the Challenge. I was thinking that there was another trigger that activates the challenge and the other variables already set, but blah I don't know... I part this as a hard challenge..
My guess on the Trick Q is that if the trigger just kills the unit, the hero cannot gain the bounty and the experience, so if the hero causes to damage them then thats thats it

Code:
Assignment
    Events
        Unit - A unit Starts the effect of an ability
    Conditions
        (Ability being cast) Equal to War Stomp
    Actions
        Set Pooper = (Casting Unit)
        Set Poop = (Target unit of ability being cast)
        Set PooperL = (Position of Pooper)
        Set PoopL = (Position of PoopL)
        Set PoopG = (Units within 500 of PooperL matching (((Matching Unit) is alive) Equal to True) and (((Matching Unit) belongs to an enemy of Pooper) Equal to True)
        For Each (Integer A) from 1 to 10 and do (Actions)
            Loop - Actions
                Special Effect - Create a [Warstomp] on PoopL
                Set PoopFX[Integer A] = (Last Created Special Effect)
        If (All conditions are true) then do (Actions) else do (Else Actions)
            If - Conditions
                (Level of War Stomp) Greater than or Equal to 3
            Then - Actions
                Unit Group - Pick every unit in PoopG and do (Actions
                    Loop - Actions
                        Unit - Make (Picked Unit) explode on death
                        Unit - Cause Pooper to damage (Picked Unit) for 9999999.00 damage of attack type Siege damage type normal
            Else - Actions
                Game - Display to (All Players) for 2.00 seconds text: |cffffcc00The level of your War Stomp is not Level 3 or Higher.
        For Each (Integer B) from 1 to 10 and do (Special Effect - Destroy PoopFX[Integer B])
        Custom script: call RemoveLocation(udg_PooperL)
        Custom script: call RemoveLocation(udg_PoopL)
        Custom script: call DestroyGroup(udg_PoopG)
 
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