• 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.
  • Create a faction for Warcraft 3 and enter Hive's 19th Techtree Contest: Co-Op Commanders! Click here to enter!
  • Create a void inspired texture for Warcraft 3 and enter Hive's 34th Texturing Contest: Void! Click here to enter!
  • The Hive's 21st Texturing Contest: Upgrade is now concluded, time to vote for your favourite set of icons! Click here to vote!

Unit Group leak question

Status
Not open for further replies.
Level 14
Joined
Aug 30, 2004
Messages
909
I have a unit group that I use for my "bombers." I add 2 bombers to the unit group every minute. I don't every destroy the unit group because it's always in use.

Do I have to manually remove dead units from the unit group or are they removed when they die normally?
 
Yeah, adding units into a unit group, that's not set by a variable, it will not leak.
E.g.
  • Set UnitGroup = (Units in (Playable Map area))
  • Custom script: call DestroyGroup (udg_UnitGroup)
the above leaks, that's why it needs the Custom script.

  • Unit Group - Add (Triggering unit) to UnitGroup
the above doesn't leak, but you will need this too:
  • Trigger - Add to Trigger2 <gen> the event (Unit - (Triggering unit) dies)
  • Trigger2
  • Events
  • Conditions
    • ((Triggering unit) is in UnitGroup) Equal to True
  • Actions
    • Unit Group - Remove (Triggering unit) from UnitGroup
 
Status
Not open for further replies.
Top