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

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