Anti-leaking problem

Skippy

Active Member
Reaction score
39
Hi there,
I had a simple trigger:
Trigger:
  • Normal
    • Events
      • Time - Every 1.00 seconds of game time
    • Conditions
    • Actions
      • Player Group - Pick every player in (All players) and do (Actions)
        • Loop - Actions
          • Player - Add 1 to (Picked player) Current gold


But this trigger causes memory leaks. So I changed it into:
Trigger:
  • Normal
    • Events
      • Time - Every 1.00 seconds of game time
    • Conditions
    • Actions
      • Set Temp_Player_Group = (All players)
      • Player Group - Pick every player in Temp_Player_Group and do (Actions)
        • Loop - Actions
          • Player - Add 1 to (Picked player) Current gold
      • Custom script: call DestroyForce( udg_Temp_Player_Group)

and think it is ok now. However, it works only once, not periodicaly every 1 second. WHY????
 

TheSpoon

New Member
Reaction score
10
I don't know why that doesn't work,
Doesn't work on mine either.

Anyway heres a working alternative:
Code:
Add Gold
    Events
        Time - Every 1.00 seconds of game time
    Conditions
    Actions
        For each (Integer A) from 1 to 12, do (Actions)
            Loop - Actions
                Player - Add 1 to (Player((Integer A))) Current gold

Edit: Trees123 is right I think, which makes my trigger pointless : <
 

Skippy

Active Member
Reaction score
39
That's the problem, I don't know how to determine what causes leaks and what doesn't.
 

Avahor

New Member
Reaction score
0
change Time - Every 1.00 seconds of game time
for Time - Every 1.00 seconds

and define amount of normal time to equal a 1 second game-time. that´s minor
 

HydraRancher

Truth begins in lies
Reaction score
197
What DOESNT cause leaks but is thought to:

Present: This means they are already existent, therefore don't leak
(Playable Map Area) - Region
Player Group - Player # - Player Group
(All Players) - Player Group
---And so on-----

Definite Leaks:
Every type of "Point", position, center etc.
Every type of "Region" apart from the specified
Every type of "Player Group" apart from the specified
Every type of "Unit Group", count units in region <gen>, etc.
Every type of "String" These are un-fixable but are re-used
 

Skippy

Active Member
Reaction score
39
Is this correct?
Trigger:
  • Unit - Move (Triggering unit) instantly to (Position of My_unit 001 &lt;gen&gt;), facing my_angle
 

Skippy

Active Member
Reaction score
39
And what about "composite" functions? Is (for example) this correct??
Trigger:
  • Set Temp_Unit_Group = (Units within 400.00 of (Position of (Triggering unit)) matching (((Triggering unit) belongs to an enemy of (Owner of (Matching unit))) Equal to True))
 

Moridin

Snow Leopard
Reaction score
144
Well I think that leaks at:
Position of

You'll need to set it as a point variable and destroy it after.
 
General chit-chat
Help Users
  • No one is chatting at the moment.

      The Helper Discord

      Members online

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top