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

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