• 🏆 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!
  • It's time for the first HD Modeling Contest of 2024. Join the theme discussion for Hive's HD Modeling Contest #6! Click here to post your idea!

This Trigger leaks, How do i fix?

Status
Not open for further replies.
Level 5
Joined
Jun 8, 2009
Messages
101
  • Summon ReDead1
    • Events
      • Time - Every 120.00 seconds of game time
    • Conditions
    • Actions
      • Unit - Create (Random integer number between 1 and 4) ReDead (lv1) for Player 10 (Light Blue) at (Center of ReDead1 <gen>) facing Default building facing degrees
      • Unit Group - Pick every unit in (Units in ReDead1 <gen>) and do (Unit - Order (Picked unit) to Attack-Move To (Center of ReDead Attack <gen>))

Ive tried reading some of the tutorials in regards to fixing leaks, but when i try to do some of the stuff i just get trigger errors, can someone tell me the proper way to fix a leak in this certain situation?
 
Level 17
Joined
Jun 17, 2010
Messages
2,275
  • Summon ReDead1
    • Events
      • Time - Every 120.00 seconds of game time
    • Conditions
    • Actions
      • Set Spawn = (Center of reDead1 <gen>)
      • Unit - Create (Random integer number between 1 and 4) ReDead (lv1) for Player 10 (Light Blue) at spawn facing Default building facing degrees
      • Custom script: call RemoveLocation(udg_Spawn)
      • Set UnitGroup = Pick every player in Spawn
      • Unit Group - Pick every unit in UnitGroup and do (Unit - Order (Picked unit) to Attack-Move To (Center of ReDead Attack <gen>))
      • Custom script: call DestroyGroup(udg_UnitGroup)

Edit: udg_<your variable>, if you dont have your variable that u used next to udg then it will cause a script error
 
Level 33
Joined
Mar 27, 2008
Messages
8,035
In lolzinyourface trigger...
Do you even HAVE variables..???
LoL

EDIT:
To clean leaks, variables must be set up in the trigger itself
Otherwise, leaks will run freely without anything trying to clean them (sheesh, like a virus they are...)
 
Level 9
Joined
Oct 11, 2009
Messages
477
  • Summon ReDead1
    • Events
      • Time - Every 120.00 seconds of game time
    • Conditions
    • Actions
      • Set Temp_Point[0] = (Center of (ReDead1 <gen>))
      • Unit - Create (Random integer number between 1 and 4) ReDead (lv1) for Player 10 (Light Blue) at Temp_Point[0] facing Default building facing degrees
      • Custom script: call RemoveLocation(udg_Temp_Point[0])
      • Set Temp_Point[1] = (Center of (ReDead Attack <gen>))
      • Set Temp_Group = (Units in (ReDead Attack <gen>))
      • Unit Group - Pick every unit in Temp_Group and do (Unit - Order (Picked unit) to Attack-Move To Temp_Point[1]
      • Custom script: call RemoveLocation(udg_Temp_Point[1])
      • Custom script: call DestroyGroup(udg_Temp_Group)
This trigger does not leak anymore.

Note that you must create your own variables. In cleaning the Unit Group(group) and Point(location) leaks, udg_ prefix must be included before the name of the specific variable.

Hope it helped you..... Please PM me if you want to know more about memory leaks.
 
Level 5
Joined
Jun 8, 2009
Messages
101
  • Summon ReDead1
    • Events
      • Time - Every 120.00 seconds of game time
    • Conditions
    • Actions
      • Set Temp_Region[0] = ReDead1 <gen>
      • Unit - Create (Random integer number between 1 and 4) ReDead (lv1) for Player 10 (Light Blue) at (Center of ReDead1 <gen>) facing Default building facing degrees
      • Custom script: call RemoveLocation(udg_Temp_Region[0])
      • Unit Group - Pick every unit in (Units in ReDead1 <gen>) and do (Unit - Order (Picked unit) to Attack-Move To (Center of ReDead Attack <gen>))
why do i get an error here? I gave the trigger an array and everything i dono...
 
Status
Not open for further replies.
Top