• 🏆 Texturing Contest #33 is OPEN! Contestants must re-texture a SD unit model found in-game (Warcraft 3 Classic), recreating the unit into a peaceful NPC version. 🔗Click here to enter!
  • It's time for the first HD Modeling Contest of 2024. Join the theme discussion for Hive's HD Modeling Contest #6! Click here to post your idea!

[Trigger] Will this leak?

Status
Not open for further replies.
Level 5
Joined
Aug 18, 2013
Messages
85
  • Castle Betrayal
    • Events
      • Time - Elapsed game time is 300.00 seconds
    • Conditions
    • Actions
      • Set SpawnPointCB = (Position of Castle Defences 0125 <gen>)
      • Sound - Play HumanCallToArmsWhat1 <gen> at 100.00% volume, located at SpawnPointCB with Z offset 0.00
      • Custom script: call RemoveLocation(udg_SpawnPointCB)
      • Unit - Change ownership of Castle Defences 0125 <gen> to Neutral Passive and Change color
      • Unit - Change ownership of Castle Defences 0144 <gen> to Neutral Passive and Change color
      • Set SpawnPointCB = (Center of Betrayal 1 <gen>)
      • Unit - Create 6 Peasant for Player 6 (Orange) at SpawnPointCB facing Default building facing degrees
      • Custom script: call RemoveLocation(udg_SpawnPointCB)
      • Game - Display to (All players) the text: The peasants of Mac...
      • Set SpawnPointCB = (Center of Betrayal 2 <gen>)
      • Unit - Create 4 Swordsman for Player 1 (Red) at SpawnPointCB facing Default building facing degrees
      • Custom script: call RemoveLocation(udg_SpawnPointCB)
      • Wait 1.00 seconds
      • Set SpawnPointCB = (Position of Castle Defences 0125 <gen>)
      • Cinematic - Ping minimap for Player Group - Player 9 (Gray) at SpawnPointCB for 5.00 seconds, using a Warning ping of color (100.00%, 5.00%, 5.00%)
      • Custom script: call RemoveLocation(udg_SpawnPointCB)
      • Set SpawnPointCB = (Position of Castle Defences 0125 <gen>)
      • Cinematic - Ping minimap for Player Group - Player 11 (Dark Green) at SpawnPointCB for 5.00 seconds, using a Warning ping of color (100.00%, 5.00%, 5.00%)
      • Custom script: call RemoveLocation(udg_SpawnPointCB)
      • Set SpawnPointCB = (Position of Castle Defences 0125 <gen>)
      • Cinematic - Ping minimap for Player Group - Player 12 (Brown) at SpawnPointCB for 5.00 seconds, using a Warning ping of color (100.00%, 5.00%, 5.00%)
      • Custom script: call RemoveLocation(udg_SpawnPointCB)
      • Set PlayerSND = Player 9 (Gray)
      • Custom script: if GetLocalPlayer() == udg_Player then
      • Sound - Play MapPing <gen>
      • Custom script: endif
      • Set PlayerSND = Player 11 (Dark Green)
      • Custom script: if GetLocalPlayer() == udg_Player then
      • Sound - Play MapPing <gen>
      • Custom script: endif
      • Set PlayerSND = Player 12 (Brown)
      • Custom script: if GetLocalPlayer() == udg_Player then
      • Sound - Play MapPing <gen>
      • Custom script: endif
 
Level 13
Joined
Dec 21, 2010
Messages
541
I suppose you need to make SpawnPointCB to array... because you used it too much..
  • Castle Betrayal
    • Events
      • Time - Elapsed game time is 300.00 seconds
    • Conditions
    • Actions
      • Set SpawnPointCB[0] = (Position of Castle Defences 0125 <gen>)
      • Set SpawnPointCB[1] = (Center of Betrayal 1 <gen>)
      • Set SpawnPointCB[2] = (Center of Betrayal 2 <gen>)
      • Sound - Play HumanCallToArmsWhat1 <gen> at 100.00% volume, located at SpawnPointCB[0] with Z offset 0.00
      • Unit - Change ownership of Castle Defences 0125 <gen> to Neutral Passive and Change color
      • Unit - Change ownership of Castle Defences 0144 <gen> to Neutral Passive and Change color
      • Unit - Create 6 Peasant for Player 6 (Orange) at SpawnPointCB[1] facing Default building facing degrees
      • Game - Display to (All players) the text: The peasants of Mac...
      • Unit - Create 4 Swordsman for Player 1 (Red) at SpawnPointCB[2] facing Default building facing degrees
      • Custom script: call RemoveLocation(udg_SpawnPointCB[0])
      • Custom script: call RemoveLocation(udg_SpawnPointCB[1])
      • Custom script: call RemoveLocation(udg_SpawnPointCB[2])
      • Wait 1.00 seconds
      • Set SpawnPointCB[0] = (Position of Castle Defences 0125 <gen>)
      • Cinematic - Ping minimap for Player Group - Player 9 (Gray) at SpawnPointCB[0] for 5.00 seconds, using a Warning ping of color (100.00%, 5.00%, 5.00%)
      • Cinematic - Ping minimap for Player Group - Player 11 (Dark Green) at SpawnPointCB[0] for 5.00 seconds, using a Warning ping of color (100.00%, 5.00%, 5.00%)
      • Cinematic - Ping minimap for Player Group - Player 12 (Brown) at SpawnPointCB[0] for 5.00 seconds, using a Warning ping of color (100.00%, 5.00%, 5.00%)
      • Custom script: call RemoveLocation(udg_SpawnPointCB[0])
      • Set PlayerSND = Player 9 (Gray)
      • Custom script: if GetLocalPlayer() == udg_PlayerSND then
      • Sound - Play MapPing <gen>
      • Custom script: endif
      • Set PlayerSND = Player 11 (Dark Green)
      • Custom script: if GetLocalPlayer() == udg_PlayerSND then
      • Sound - Play MapPing <gen>
      • Custom script: endif
      • Set PlayerSND = Player 12 (Brown)
      • Custom script: if GetLocalPlayer() == udg_PlayerSND then
      • Sound - Play MapPing <gen>
      • Custom script: endif
 
Last edited:
Level 24
Joined
Aug 1, 2013
Messages
4,657
Replace "Wait 1.00 seconds" with a custom script that will call a customized function of PolledWait() (Wait <real> seconds of gametime)
"Wait <real> seconds" should only be used in very weird situations because it is not the wait of the game but the wait in real life seconds. Even pausing the game won't stop the wait.
"Wait <real> seconds of gametime" does use the gametime... but is (equal as wait) very inaccurate, and it also leaks.
That is why you need a customized Wait timer or use a regular timer.

Also, should udg_Player not be udg_PlayerSND?
 

Kazeon

Hosted Project: EC
Level 33
Joined
Oct 12, 2011
Messages
3,449
I somehow think that the thread starter asked is there any leak in the trigger or not. Or is it just me? Nvm

Anyway, I can't notice any leak in the trigger you showed above :)


EDIT:
  • Set SpawnPointCB = (Position of Castle Defences 0125 <gen>)
  • Cinematic - Ping minimap for Player Group - Player 9 (Gray) at SpawnPointCB for 5.00 seconds, using a Warning ping of color (100.00%, 5.00%, 5.00%)
  • Custom script: call RemoveLocation(udg_SpawnPointCB)
  • Set SpawnPointCB = (Position of Castle Defences 0125 <gen>)
  • Cinematic - Ping minimap for Player Group - Player 11 (Dark Green) at SpawnPointCB for 5.00 seconds, using a Warning ping of color (100.00%, 5.00%, 5.00%)
  • Custom script: call RemoveLocation(udg_SpawnPointCB)
  • Set SpawnPointCB = (Position of Castle Defences 0125 <gen>)
  • Cinematic - Ping minimap for Player Group - Player 12 (Brown) at SpawnPointCB for 5.00 seconds, using a Warning ping of color (100.00%, 5.00%, 5.00%)
  • Custom script: call RemoveLocation(udg_SpawnPointCB)
SpawnPointCB refers to an exactly same location. You just need to set and destroy it once.
  • Set SpawnPointCB = (Position of Castle Defences 0125 <gen>)
  • Cinematic - Ping minimap for Player Group - Player 9 (Gray) at SpawnPointCB for 5.00 seconds, using a Warning ping of color (100.00%, 5.00%, 5.00%)
  • Cinematic - Ping minimap for Player Group - Player 11 (Dark Green) at SpawnPointCB for 5.00 seconds, using a Warning ping of color (100.00%, 5.00%, 5.00%)
  • Cinematic - Ping minimap for Player Group - Player 12 (Brown) at SpawnPointCB for 5.00 seconds, using a Warning ping of color (100.00%, 5.00%, 5.00%)
  • Custom script: call RemoveLocation(udg_SpawnPointCB)
 

Dr Super Good

Spell Reviewer
Level 63
Joined
Jan 18, 2005
Messages
27,197
it could leak but considering how late in the game it runs you should not need to worry about it. i am not an expert on leaks though.
It runs 5 minutes into a session. Not even Hero of the Storm sessions finish before then.

Since it only runs once and performs no huge iteration the amount it can leak is minimal so can be considered trivial.
 
Status
Not open for further replies.
Top