[Trigger] Question about leaks

Status
Not open for further replies.
Level 29
Joined
Jul 29, 2007
Messages
5,174
Every time you use the trigger it leaks again.
Triggers that run multiple time should ALWAYS be leakless !

If you don't know the custom script to remove leaks here it (they) is:

Point remove
  • Custom script: call RemoveLocation(udg_YourPoint'sName)
If its an array just put "(udg_YourPoint'sName[array])".


Unit Groups
  • Custom script: set bj_wantDestroyGroup = true
Put this BEFORE you pick the units and it will remove the unit group after it finished using it (don't use this if you have more uses for the group).


  • Set Unit_Group = bla bla bla
  • Unit - Order Unit_Group to bla bla bla
  • Custom script: call DestroyGroup(udg_Unit_Group)

Use this if the group has actions after the unit group did its unit group actions.
 
Level 6
Joined
Nov 28, 2007
Messages
203
I've made a map that were setting around 1000 point variables/second... it didn't lag at all. Even if I played it for 4 hours.

[EDIT]: And that's 1,440,000,0 (fourteen millions and fourhundred thousand) variables...
 
Level 9
Joined
May 27, 2006
Messages
498
Well, if you want, you can check it on your own - just make a periodic trigger
  • Events:
    • Time - Every 0.5 second of game time
  • Conditions:
  • Actions:
    • Set TempPoint = (Random point in(Playable map area))
    • Unit - Create 1 Footman for (Player 1(Red)) at TempPoint facing (Default building facing degrees)

Every 0.5 second new unit and point are created, but are not removed - run map and wait few seconds, game will start to lagg like hell, even if its not online.
After your w3 (probably) crashed, just add the remove TempPoint custom script line at the end of the trigger, run map and wait. The game should start lagging a lot later.

@Up
Arh... faster.
Well, you know, just setting variables and leaving them unused doesn`t leak. But when you create a unit/special effect/anything, then it leaks.
 
Status
Not open for further replies.
Top