• 🏆 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!
  • 🏆 Hive's 6th HD Modeling Contest: Mechanical is now open! Design and model a mechanical creature, mechanized animal, a futuristic robotic being, or anything else your imagination can tinker with! 📅 Submissions close on June 30, 2024. Don't miss this opportunity to let your creativity shine! Enter now and show us your mechanical masterpiece! 🔗 Click here to enter!

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