Simple Leak Question

the_ideal

user title
Reaction score
61
Trigger:
  • Game - Display to (Player group((Owner of (Triggering unit)))) for 5.00 seconds the text: Unit upgrade will o...


Will this leak the player group if is run multiple times? I'm guessing it does, but I don't want to have to go through my entire map if it doesn't. I looked at the tutorial for leaks but I'm still not clear about this one.

Thanks a lot!

(Note: please don't answer unless you're sure you're right. =p)
 

Ayanami

칼리
Reaction score
288
You can do this to prevent the leak:

Trigger:
  • Actions
    • Set TempForce = (Player group((Owner of (Triggering unit))))
    • Game - Display to TempForce for 5.00 seconds the text: Unit upgrade will o...
    • Custom script: call DestroyForce(udg_TempForce)


TempForce is a player group variable.
 

Laiev

Hey Listen!!
Reaction score
188
players leak but if you 'destroy' it, probably you'll got some problems... because players are always used in game

just do a little test :p

Trigger:
  • .
    • set TempForce = (All Players)
    • call DestroyForce(udg_TempForce)


test this :rolleyes: and you'll see what you're doing xP (this will cause problem... is just to you see)
 

Ayanami

칼리
Reaction score
288
players leak but if you 'destroy' it, probably you'll got some problems... because players are always used in game

just do a little test :p

Trigger:
  • .
    • set TempForce = (All Players)
    • call DestroyForce(udg_TempForce)


test this :rolleyes: and you'll see what you're doing xP (this will cause problem... is just to you see)

I believe destroying player group doesn't do that? Only if "All Players" is destroyed, then it won't be usable again. I think "Owner of (Triggering unit)" works fine even if the player group is destroyed.
 

the_ideal

user title
Reaction score
61
I believe destroying player group doesn't do that? Only if "All Players" is destroyed, then it won't be usable again. I think "Owner of (Triggering unit)" works fine even if the player group is destroyed.

Yes, because you're not destroying Owner of (Triggering Unit), you're destroying a variable that's set to whatever player happened to be the owner of the trigging unit.
 

Laiev

Hey Listen!!
Reaction score
188
Yes, because you're not destroying Owner of (Triggering Unit), you're destroying a variable that's set to whatever player happened to be the owner of the trigging unit.

o.õ' set a variable to a value, and then destroy it, you'll destroy the value...

for example my example...

you destroy the variable... but it bug everything
 

Accname

2D-Graphics enthusiast
Reaction score
1,462
if you set a variable to be the player group "Owner of Triggering Unit" and you destroy it you will just destroy the variable not the player nor whatever.
its like setting the variable to nothing.

though beware of some global variables set in the game by default, "All Players" for example is a global variable. Using it will not leak.
however destroying it might have fatal consequences.
 
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