• Listen to a special audio message from Bill Roper to the Hive Workshop community (Bill is a former Vice President of Blizzard Entertainment, Producer, Designer, Musician, Voice Actor) 🔗Click here to hear his message!
  • Read Evilhog's interview with Gregory Alper, the original composer of the music for WarCraft: Orcs & Humans 🔗Click here to read the full interview.

Does this GUI trigger leak? And why doesn't it work correctly?

Status
Not open for further replies.
Level 4
Joined
Jul 28, 2008
Messages
93
  • Crystal Generator
    • Events
      • Time - Every (Random real number between 10.00 and 60.00) seconds of game time
    • Conditions
    • Actions
      • Set Temp_Group = (Units of type Crystal Generator)
      • Set Temp_Point = (Position of (Picked unit))
      • Unit Group - Pick every unit in Temp_Group and do (Item - Create Red Crystal at (Temp_Point offset by ((Random real number between -100.00 and 100.00), (Random real number between -100.00 and 100.00))))
      • Custom script: call RemoveLocation (udg_Temp_Point)
      • Custom script: call DestroyGroup (udg_Temp_Group)
Just curious, would this trigger leak? i was aiming to remove leaks from my map, but when i put it in this format the crystals would spawn at obscure points on the other side of the map. And i never changed the offset point (was intended to spawn within 2 squares of the generator, not 50....)
 
Level 4
Joined
Jul 28, 2008
Messages
93
Er, actually gonna rephrase the question, how would i remove the leak from this trigger? (The trigger above wouldn't function correctly, but this one does)
Crystal Generator
  • Events
    • Time - Every (Random real number between 10.00 and 60.00) seconds of game time
    • Conditions
    • Actions
      • Set Temp_Group = (Units of type Crystal Generator)
      • Unit Group - Pick every unit in Temp_Group and do (Item - Create Red Crystal at ((Position of (Picked unit)) offset by ((Random real number between -100.00 and 100.00), (Random real number between -100.00 and 100.00))))
      • Custom script: call DestroyGroup (udg_Temp_Group)
Or does it not leak at all?
 
Level 4
Joined
Jul 28, 2008
Messages
93
You need a location, maybe call it "Temp_Loc" and set the "Position of Picked Unit" to "Temp_Loc"

then, do your unit-group call and have it create the crystal at "Temp_Loc"

that should take care of your leak

But, isn't that what i did in the first trigger? (When i did it (point variable) it didn't function correctly, spawned the crystals in the middle)
 
Level 4
Joined
Nov 24, 2007
Messages
55
oh, you're right. The reason it didn't work is that asking for the "Picked Unit" before you're doing any picking, so the game doesn't have any unit to pick.

So what you shoudl do is this:

For the "Unit Group - " Action, select this command from the GUI:

Unit Group - Pick Every Unit in Group and Do Multiple Actions

This will then add a little tree to the bottom of the "Unit Group -" Action in which you can do multiple (think of it as a loop that will run as many times as there are units in the group, doing what you specify below)

Then, inside the tree (loop) of "Unit Group - " make the first Action inside of there setting the location to the picked unit (Now that it has picked a unit, there is such a thing and it can get its location)"

Then, make the 2nd action in the loop the Item - Create... step.

Hope this works
 
Status
Not open for further replies.
Top