• 🏆 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!

Memory Leak Help

Status
Not open for further replies.
Level 8
Joined
Aug 29, 2007
Messages
277
I've been trying to get this trigger to be as leakless as possible but I can't find out what is wrong with with it. (And only 12 of the many units move:slp:)
  • Zombie attack
    • Events
      • Time - Every 1.00 seconds of game time
    • Conditions
    • Actions
      • Set The_Undead = (Units owned by Player 12 (Brown))
      • Unit Group - Pick every unit in The_Undead and do (Unit - Order (Picked unit) to Attack-Move To (Position of (Random unit from (Units owned by Neutral Passive))))
      • Custom script: call DestroyGroup (udg_The_Undead)

Help will be greatly appreciated as this has plagued me for such a long time.


(Off topic: I also would love to know the name of the item system used in TKoK (Before 2.00))
 
Level 11
Joined
Aug 25, 2006
Messages
971
I found your leak. What you did with the group was great. However you need to do the same thing with points. The destroy function is "call RemoveLocation(X)" Where X is location(point).
 
Level 8
Joined
Aug 29, 2007
Messages
277
  • Zombie attack
    • Events
      • Time - Every 1.00 seconds of game time
    • Conditions
    • Actions
      • Set The_Undead = (Units owned by Player 12 (Brown))
      • Set Random_Location = (Position of (Random unit from (Units owned by Neutral Passive)))
      • Unit Group - Pick every unit in The_Undead and do (Unit - Order (Picked unit) to Attack-Move To Random_Location)
      • Custom script: call DestroyGroup (udg_The_Undead)
      • Custom script: call RemoveLocation (udg_Random_Location)

So should this do it then?
 
Level 11
Joined
Aug 25, 2006
Messages
971
Yes that should do nicely.
(If you read my original post, I misread the GUI for a moment)
Wait! I found another leak. "Random Unit from (UNITGROUP)"
Thats a unit group and will leak!
Go like this
Set The_Undead = Units owned by neutral passive
CustomScript: call DestroyGroup(udg_The_Undead)
Set The_Undead = Units Owned by Player 12
..rest of the trigger...
CustomScript: call DestroyGroup(udg_The_Undead)
 
Level 8
Joined
Aug 29, 2007
Messages
277
  • Zombie attack
    • Events
      • Time - Every 1.00 seconds of game time
    • Conditions
    • Actions
      • Set The_Undead = (Units owned by Player 12 (Brown))
      • Set Civilians = (Units owned by Neutral Passive)
      • Set Random_Location = (Position of (Random unit from Civilians))
      • Unit Group - Pick every unit in The_Undead and do (Unit - Order (Picked unit) to Attack-Move To Random_Location)
      • Custom script: call DestroyGroup (udg_The_Undead)
      • Custom script: call DestroyGroup (udg_Civilians)
      • Custom script: call RemoveLocation (udg_Random_Location)
Would this work? (Though it seems like it still leaks and still only 12 units are affected the way I want them to)
 
Level 11
Joined
Aug 25, 2006
Messages
971
I personally don't see any leaks. How exactly do you get the idea its leaking? Oh and if you order too many units (perhaps a few hundred at a time) to move/patrol/attack-move it won't function very will. Perhaps if I see the map I can offer additional help?
 
Status
Not open for further replies.
Top