• Listen to a special audio message from Bill Roper to the Hive Workshop community (Bill is a former Vice President of Blizzard Entertainment, Producer, Designer, Musician, Voice Actor) 🔗Click here to hear his message!
  • Read Evilhog's interview with Gregory Alper, the original composer of the music for WarCraft: Orcs & Humans 🔗Click here to read the full interview.

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 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