Lesson 1: GUI "General" Functions

I

IKilledKEnny

Guest
Tonks forces do leak (all execpt "All Players" force) handle is ancestor of force, thus forces leaks.

> Sooda

Code:
-------- TempG = Nulled unit group --------
-------- TempP = Nulled location --------
-------- TempU = Nulled unit --------

I believe those explain what each variable is?

> Andrewgosu

I agree, but I thought of it as tutorial beucase the assignment involved comments. Don't worry, on regular triggers I don't take half of my time to write comments. :p
 

undeadorcjerk

The Ulitimate TheHelper.net Lurker
Reaction score
223
Code:
Events
Conditions
Actions
    -------- First we set the variable. --------
    Set UnitGroup = (Units in (Playable map area))
    -------- Then we pick a random unit. --------
    Set PickedUnit = (Random unit from UnitGroup)
    -------- And we tell it to move. --------
    Unit - Order PickedUnit to Move To (Center of Move Here Plz <gen>)
    -------- Next we color the little bugger. --------
    Unit - Change color of PickedUnit to Blue
    -------- Now we remove the variables. --------
    Custom script:   call DestroyGroup(udg_UnitGroup)
    -------- Next we take a nap! :) --------
    Wait 1000000000.00 seconds
If i did that right, ill be surprised. I don't have so great of luck when it comes to triggers.
 

Azylaminaz

Vox Populi
Reaction score
91
Code:
Trigger...
    Events
        Player - Player 1 (Red) types a chat message containing Blue!!! as An exact match
    Conditions
    Actions
        Set Temp_Group = (Units in (Entire map))
        Set Temp_Unit = (Random unit from Unit_Group)
        Set Temp_Point = (Center of (Entire map))
        Unit - Change color of Temp_Unit to Blue
        -------- OR --------
        Animation - Change Temp_Unit's vertex coloring to (0.00%, 0.00%, 100.00%) with 0.00% transparency
        -------- You should have told me which blue. o.o --------
        Unit - Move Temp_Unit instantly to Temp_Point
        Custom script: call DestroyGroup (udg_Temp_Group)
        Custom script: call RemoveLocation (udg_Temp_Point)
You said to make it blue... not which kind of blue.. Make it look like if it was owned by player blue? Or just make the unit blue. Lol. I don't normally make triggers much(because I don't make maps... only edit when people ask for help), but when ever I do. I check if it has leaks(mainly only repeated ones).

Why are unit leaks in both, yours and the one you did, just simple point leaks? Is there no way to really remove udg_Temp_Unit? I thought it was a leak.. It seems if it isn't removed, it is overwritten, which I think is bad? o.o

In the Leak Checker, what does this mean:
Code:
 Location variable has not been removed: Temp_Unit
 Location variable has not been removed: Temp_Point
I always get it in all my triggers, but it tells me I have no memory leaks. o.o Just confuses me.

Tonks said:
I don't think that the spaces matter in that case, but I'm not entirely positive. I'm not particularly Jass-savvy.
Could someone who knows about Jass please confirm / correct that statement?
JASS = Coding, thus, spaces don't matter.
 

PurgeandFire

zxcvmkgdfg
Reaction score
508
Code:
Events
Conditions
Actions
    -------- First we set the variable. --------
    Set UnitGroup = (Units in (Playable map area))
    -------- Then we pick a random unit. --------
    Set PickedUnit = (Random unit from UnitGroup)
    -------- And we tell it to move. --------
    Unit - Order PickedUnit to Move To (Center of Move Here Plz <gen>)
    -------- Next we color the little bugger. --------
    Unit - Change color of PickedUnit to Blue
    -------- Now we remove the variables. --------
    Custom script:   call DestroyGroup(udg_UnitGroup)
    -------- Next we take a nap! :) --------
    Wait 1000000000.00 seconds
If i did that right, ill be surprised. I don't have so great of luck when it comes to triggers.

There is one small problem, the "Center of Move Here Plz <gen>" leaks. You first need to set it to a variable:
Code:
set TempPoint = Center of Move Here Plz <gen>
Use it, then remove it:
Code:
Custom Script: call RemoveLocation(udg_TempPoint)

@Azylaminaz:
Nope, spaces don't matter... Well, at least in some cases, and I just know it won't syntax. :D

Anyways, Temp_Unit isn't a location variable, so it doesn't need to be removed... Temp_Point should be removed through "call RemoveLocation(udg_Temp_Point)"

--------------------------------
*Off-Topic:I'm_On_56k's leak checker isn't that good, because it misses some leaks, but only catches obvious ones. If you need me to leak check some work, you can PM me them or post a new thread.
--------------------------------

Otherwise, I don't have a clue on what's the problem. :rolleyes:
 

Akatsuki

New Member
Reaction score
24
Here's my assignment for when you come back.

Code:
Assignment
    Events
    Conditions
    Actions
        -------- I first will set my variables. --------
        -------- I will set the variable Temp_Group = Unit in (playable map area) so that I may remove it later to prevent a memory leak. --------
        Set Temp_Group = (Units in (Playable map area))
        -------- I will set my Temp_Unit(Unit variable) to (Random unit from Temp_Group which is (Units in (Playable map area)) to prevent a memory leak. --------
        Set Temp_Unit = (Random unit from Temp_Group)
        -------- I will set my point variable which is named Temp_Point to (Center of (Playable map area)) so that I may remove it so it would prevent a memory leak. --------
        Set Temp_Point = (Center of (Playable map area))
        -------- I will now change the color of my Temp_Unit in to the color Blue. --------
        Unit - Change color of Temp_Unit to Blue
        -------- I will now make my Temp_Unit move to Temp_Point. --------
        Unit - Order Temp_Unit to Move To Temp_Point
        -------- I will now remove my Temp_Point variable to prevent a memory leak. --------
        Custom script:   call RemoveLocation(udg_Temp_Point)
        -------- I will now remove my Temp_Group to prevent a memory leak. --------
        Custom script:   call DestroyGroup(udg_Temp_Group)
 

pheonixashes

Those who misplace trust in gods learn their fate.
Reaction score
65
Ok, I'm finished with mine; don't laugh, it's my first attempt at doing real triggers.

Ok, here it is.

Code:
Events
    Time - Every 10.00 seconds of game time
Conditions
Actions
    ---- The UnitToBlueGroup variable is to set a unit group so I can choose a unit in this Unit Group later. ----
    Set UnitToBlueGroup = (Units in (Playable map area))
    ---- The UnitToBlue is simply the unit that is going to move and change color. ----
    Set UnitToBlue = (Random unit from UnitToBlueGroup)
    ---- UnitToBlueMove is the location where the newly "blued" unit is going to move to. ----
    Set UnitToBlueMove = (Center of Location <gen>)
    ---- Here the picked unit (The random unit in UnitToBlue) is changing its color to blue. ----
    Unit - Change color of UnitToBlue to (Color of Player 2 (Blue))
    ---- Here the unit is being ordered to the region/location, marked by the MUSHROOMS! ----
    Unit - Order UnitToBlue to Move To UnitToBlueMove
    ---- Here I am deleting the group variable to help reduce lag, if this map was signifigantly more laggy. ----
    Custom script:   call DestroyGroup (udg_UnitToBlueGroup)
    ---- Here I am also removing the location to prevent/reduce lag. ----
    Custom script:   call RemoveLocation (udg_UnitToBlueMove)

Here's the map as well.
 

Attachments

  • Lesson 1 - General GUI Functions.w3x
    21.8 KB · Views: 118

Naminator

Coming Back To Life
Reaction score
76
This is my homework :D Like a convertion system i made. Changing The Unit Vertex Coloring unitl it's get blue. In this system if a unit it's in that region it doesn't take other unit.(Somethings are in spanish in WE, I'm from Argentina..but you can understand clearly)

I do my best here. Hope You Like It! Sry if i pass to much with the assignament, i just want it to make something different of the others.

Code:
Acontecimientos
        Jugador - Jugador 1 (rojo) types a chat message containing -Convert as Una correspondencia exacta
   Condiciones
   Acciones
    If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        Si: Condiciones
            (Number of units in (Units in Change Region <gen>)) Igual a 1
        Entonces: Acciones
            Skip remaining actions
        Otros: Acciones
    -------- Units In Map --------
    Set TempGroup = (Units in (Playable map area) matching ((Owner of (Matching unit)) No igual a Jugador 2 (azul)))
    -------- Random Unit --------
    Set RandomUnit = (Random unit from TempGroup)
    -------- Region Variable --------
    Set TempPoint = (Center of Change Region <gen>)
    -------- Actions --------
    Unidad - Move RandomUnit instantly to (Center of Change Region <gen>)
    Unidad - Activar pausa RandomUnit
    Camara - Pan camera for Jugador 1 (rojo) to (Center of Change Region <gen>) over 0.00 seconds
    Wait 0.50 seconds
    Partida - Display to (All players) for 5.00 seconds the text: |cFFFFCC00|||
    Animacion - Change RandomUnit's vertex coloring to (0.00%, 0.00%, 20.00%) with 0.00% transparency
    Wait 1.50 seconds
    Partida - Display to (All players) for 5.00 seconds the text: |cFFFFCC00||||||
    Animacion - Change RandomUnit's vertex coloring to (0.00%, 0.00%, 40.00%) with 0.00% transparency
    Wait 1.50 seconds
    Partida - Display to (All players) for 5.00 seconds the text: |cFFFFCC00|||||||||
    Animacion - Change RandomUnit's vertex coloring to (0.00%, 0.00%, 60.00%) with 0.00% transparency
    Wait 1.50 seconds
    Partida - Display to (All players) for 5.00 seconds the text: |cFFFFCC00|||||||||...
    Animacion - Change RandomUnit's vertex coloring to (0.00%, 0.00%, 80.00%) with 0.00% transparency
    Wait 1.50 seconds
    Partida - Display to (All players) for 5.00 seconds the text: |cFFFFCC00|||||||||...
    Animacion - Change RandomUnit's vertex coloring to (0.00%, 0.00%, 100.00%) with 0.00% transparency
    Wait 1.50 seconds
    Unidad - Change color of RandomUnit to Azul
    Unidad - Desactivar pausa RandomUnit
    Partida - Display to (All players) for 5.00 seconds the text: Conversion Complete
    -------- Destroy Point Variable Leak --------
    Custom script:   call RemoveLocation (udg_TempPoint)
    -------- Destroy Group Variable Leak --------
    Custom script:   call DestroyGroup(udg_TempGroup)

Here is the other if the first one was to much

Code:
Acontecimientos
        Jugador - Jugador 1 (rojo) types a chat message containing -Convert as Una correspondencia exacta
    Condiciones
    Acciones
        -------- Units In Map --------
        Set TempGroup = (Units in (Playable map area) matching ((Owner of (Matching unit)) No igual a Jugador 2 (azul)))
        -------- Random Unit --------
        Set RandomUnit = (Random unit from TempGroup)
        -------- Region Variable --------
        Set TempPoint = (Center of Change Region <gen>)
        -------- Actions --------
        Unidad - Move RandomUnit instantly to (Center of Change Region <gen>)
        -------- Change Color --------
        Unidad - Change color of RandomUnit to Azul
        -------- Destroy Point Variable Leak --------
        Custom script:   call RemoveLocation (udg_TempPoint)
        -------- Destroy Group Variable Leak --------
        Custom script:   call DestroyGroup(udg_TempGroup)
 

Tonks

New Member
Reaction score
160
I'm incredibly sorry to have to do this, but I can't finish this Classroom. Over the weekend I broke my arm and my dad is in the hospital, so I find myself incapable of continuing this class.

Again, I'm sorry. If anyone would like to take up the lesson, feel free to announce yourself. Many of you are capable of teaching it just as well as I could have.
 

PurgeandFire

zxcvmkgdfg
Reaction score
508
Awww.... So sad for the broken arm, I hope it gets better soon... :(
I could take the class up, but I think I might need to focus on my other class, but that won't be too hard. If you would like me to take over the class from here, I'd gladly do that. :eek:
 

Tonks

New Member
Reaction score
160
Awww.... So sad for the broken arm, I hope it gets better soon... :(
I could take the class up, but I think I might need to focus on my other class, but that won't be too hard. If you would like me to take over the class from here, I'd gladly do that. :eek:

Feel free to. Just take it up with whoever's managing the classroom thing these days, then post your lessons.
 
I

IKilledKEnny

Guest
Sorry to hear that Tonks, it was a nice classroom. I hope you and your father will get better soon!

> PurgeandFire

Good luck with it, you are running 2 classrooms at a time. :p I'll help if you need assitance.
 

Naminator

Coming Back To Life
Reaction score
76
Sry about your father and you...

But when your father and you gets better are you going to keep this class on? I don't know if is right to ask, but just wanna know. I really sry about you father and you.
 

PurgeandFire

zxcvmkgdfg
Reaction score
508
Sorry to hear that Tonks, it was a nice classroom. I hope you and your father will get better soon!

> PurgeandFire

Good luck with it, you are running 2 classrooms at a time. :p I'll help if you need assitance.

Lol... I didn't know that Tonks replied. Hm.. I guess I'll try to finish both classes' lessons over the weekend or maybe on Friday. Thank you, I will ask if I need help to either you or elmstfreddie. :)
 

Tonks

New Member
Reaction score
160
Sry about your father and you...

But when your father and you gets better are you going to keep this class on? I don't know if is right to ask, but just wanna know. I really sry about you father and you.

PurgeandFire is continuing the classroom unless he decides not to.

Lol... I didn't know that Tonks replied. Hm.. I guess I'll try to finish both classes' lessons over the weekend or maybe on Friday. Thank you, I will ask if I need help to either you or elmstfreddie. :)

If you need any further information about GUI Functions, I'm still happy to give you some tricks n tips.
 
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