• Check out the results of the Techtree Contest #19!
  • 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.
  • Create a void inspired texture for Warcraft 3 and enter Hive's 34th Texturing Contest: Void! Click here to enter!
  • The Hive's 22nd Icon Contest: Creep Abilities is now concluded, time to vote for your favourite set of icons! Click here to vote!

Is this triggger working and leakless?

Status
Not open for further replies.
Level 15
Joined
Aug 11, 2009
Messages
1,605
  • Ping Victims
    • Events
      • Time - Every 2.00 seconds of game time
    • Conditions
    • Actions
      • Player Group - Pick every player in (All players) and do (Actions)
        • Loop - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Matching player) Not equal to Killer
            • Then - Actions
              • Set PingGroup = (Units owned by (Picked player))
              • Unit Group - Pick every unit in PingGroup and do (Actions)
                • Loop - Actions
                  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    • If - Conditions
                      • (Unit-type of (Picked unit)) Equal to Scared Camper (Male 2)
                    • Then - Actions
                      • Cinematic - Ping minimap for (Player group(Killer)) at (Position of (Picked unit)) for 2.00 seconds
                    • Else - Actions
            • Else - Actions
      • Custom script: call DestroyGroup(udg_PingGroup)
 
Better?
  • Ping Victims
    • Events
      • Time - Every 2.00 seconds of game time
    • Conditions
    • Actions
      • Player Group - Pick every player in (All players) and do (Actions)
        • Loop - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Matching player) Not equal to Killer
            • Then - Actions
              • Set PingGroup = (Units owned by (Picked player))
              • Unit Group - Pick every unit in PingGroup and do (Actions)
                • Loop - Actions
                  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    • If - Conditions
                      • (Unit-type of (Picked unit)) Equal to Scared Camper (Male 2)
                    • Then - Actions
                      • Set PingPoint = (Position of (Picked unit))
                      • Cinematic - Ping minimap for (Player group(Killer)) at PingPoint for 2.00 seconds
                    • Else - Actions
            • Else - Actions
      • Custom script: call DestroyGroup(udg_PingGroup)
      • Custom script: call RemoveLocation(udg_PingPoint)
By the way,thx and +rep!
 
Now you just have to put your call of your point remover in your loop cause now your only removing the last saved variable in your loop to be removed.
if the condition pops twice equal to true, you'd still leak 1 point.
 
Now you just have to put your call of your point remover in your loop cause now your only removing the last saved variable in your loop to be removed.
if the condition pops twice equal to true, you'd still leak 1 point.

I didn't quite understand this...What do you mean the condition pops twice equal to true?It is supposed to be true more than once...

I know you mean to add the custom text just below the ping action,but why?
 
your code goes linear, which means your computer processes everything from the top to the bottom.

What a loop does, it keeps on going till its done, and then the allows the actions below it (that are outside your loop) to be executed.

so lets test your loop, lets say you have 2 players (example).

First time your loop, loops, it checks your condition, and lets say it's true, you save your point in your variable, and you ping at the variable position.
Now your loop loops for the second time, and lets say it's true again, you save a new position in that variable again, and you ping again.
Your loop ends and you remove the point.

Now what happens is that the second time you gave your variable information, it overwrote your first information, causing a point to go missing.
The second time you gave your variable information, you removed it neatly but thats just because your loop ended.

Imagine you have 12 players, and all of them conditions are true, you would have made 12 points to ping to, but only removed one.

I hope that answers your question as to why, if not, I could explain it a bit more detailed I guess.

As to question, yes you need to put the custom text call under your ping action, cause else it will not remove the point you pinged at right after you used it, but once the loop has ended.
 
Leak

Player groups leak So you should do this insted

  • Ping Victims
    • Events
    • Conditions
    • Actions
      • Set TempPlayerGroup = (All players)
      • -------- Your existing code here exept pick every player in TempPlayerGroup rather than all players --------
      • Custom script: call DestroyForce( udg_TempPlayerGroup )
Hope that helps
 
Status
Not open for further replies.
Back
Top