Does this Leak?

Magazette2

New Member
Reaction score
3
Code:
 Spawn Militia
    Events
        Time - Every 11.25 seconds of game time
    Conditions
    Actions
        Player Group - Pick every player in (All players) and do (Actions)
            Loop - Actions
                Set spawnpoint = ((Picked player) start location)
                Set spawnreigon = (Region centered at spawnpoint with size (384.00, 384.00))
                Set Militia = (Units owned by (Picked player) of type Militia Barracks)
                Set spawnbuilding = (Random unit from Militia)
                If ((spawnreigon contains spawnbuilding) Equal to True) then do (Unit - Create 1 Militia for (Picked player) at spawnpoint facing Default building facing degrees) else do (Do nothing)
                Custom script:   call RemoveLocation (udg_spawnpoint)
                Custom script:   call RemoveRect (udg_spawnreigon)
                Custom script:   call DestroyGroup (udg_Militia)
 

Magazette2

New Member
Reaction score
3
how leaky is it?

Code:
 Spawn Militia
    Events
        Time - Every 11.25 seconds of game time
    Conditions
    Actions
        Set allplayers = (All players)
        Player Group - Pick every player in allplayers and do (Actions)
            Loop - Actions
                Set spawnpoint = ((Picked player) start location)
                Set spawnreigon = (Region centered at spawnpoint with size (384.00, 384.00))
                Set Militia = (Units owned by (Picked player) of type Militia Barracks)
                Set spawnbuilding = (Random unit from Militia)
                If ((spawnreigon contains spawnbuilding) Equal to True) then do (Unit - Create 1 Militia for (Picked player) at spawnpoint facing Default building facing degrees) else do (Do nothing)
                Custom script:   call RemoveLocation (udg_spawnpoint)
                Custom script:   call RemoveRect (udg_spawnreigon)
                Custom script:   call DestroyGroup (udg_Militia)
        Custom script:   call DestroyForce (udg_allplayers)

is that leak free now, or i dont need to destroy the force if it never changes?
 

Magazette2

New Member
Reaction score
3
i had 16 of those triggers, different units, all going on at once and my mao was lagging like crazy when units started battle. Is that what caused it?

but i didnt do it in jass.....
 

Magazette2

New Member
Reaction score
3
bump

was it leaking before and has it stopped now

gals says it wasnt before

tinki3 says it was

please can i have a definite answer
 

AceHart

Your Friendly Neighborhood Admin
Reaction score
1,495
> Set allplayers = (All players)
> Custom script: call DestroyForce (udg_allplayers)

This is an incredibly bad idea...

"All players" is a global variable.
It doesn't leak.

However, if you destroy it... well, then any and all triggers that still want to use it will stop working.
 

Narks

Vastly intelligent whale-like being from the stars
Reaction score
90
> Set allplayers = (All players)
> Custom script: call DestroyForce (udg_allplayers)

This is an incredibly bad idea...

"All players" is a global variable.
It doesn't leak.

However, if you destroy it... well, then any and all triggers that still want to use it will stop working.

Meep.
+rep... wait... I can't give you rep... o_O
 

~GaLs~

† Ғσſ ŧħə ѕαĸε Φƒ ~Ğ䣚~ †
Reaction score
180
> Set allplayers = (All players)
> Custom script: call DestroyForce (udg_allplayers)

This is an incredibly bad idea...

"All players" is a global variable.
It doesn't leak.

However, if you destroy it... well, then any and all triggers that still want to use it will stop working.

As i said so ;););)
 

Stefanman

Member
Reaction score
10
haha,i knew All Players doesnt leaks! :p
i had problem once with that,in WHOLE map i was destroying all players player group,and when i found out that it must not be destroyed,i got pissed off!

Tinki3 can be wrong sometimes :D
 

Magazette2

New Member
Reaction score
3
I added in lots of trigger spells to my map. Before i added them my map ran fine but now it lags. I checked them all and none of them leak. Could just having lots of triggers make the game lag?
 

AceHart

Your Friendly Neighborhood Admin
Reaction score
1,495
A trigger more or less doesn't make any difference.
They certainly don't do anything just from being there.

Even hundreds of triggers are no problem. If coded correctly (leak free).


What exactly is that lag?
You just look at the map and it happens already?
Spells lag, but only on first time casts?
They always lag? What spell is that?
 
General chit-chat
Help Users
  • No one is chatting at the moment.

      The Helper Discord

      Members online

      No members online now.

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top