• Check out the results of the Techtree Contest #19!
  • 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 void inspired texture for Warcraft 3 and enter Hive's 34th Texturing Contest: Void! Click here to enter!
  • The Hive's 22nd Icon Contest: Creep Abilities is now concluded, time to vote for your favourite set of icons! Click here to vote!

How to remove Unit Group again?

Status
Not open for further replies.
Question remains, when should I destroy it?
Am I supposed to destroy only empty UnitGroups/UnitGroups I won't use anymore?
For example:
  • Set GroupVar = Pick every unit in (Playable Map Area)
  • Unit Group - Pick every unit in GroupVar and do (Unit - Hide (Picked unit))
  • Custom script: call DestroyGroup(udg_GroupVar)
  • Wait - 0.02 seconds
  • Unit Group - Pick every unit in GroupVar and do (Unit - Unhide (Picked unit))
Will it work? Or am I supposed to do it like this:
  • Set GroupVar = Pick every unit in (Playable Map Area)
  • Unit Group - Pick every unit in GroupVar and do (Unit - Hide (Picked unit))
  • Wait - 0.02 seconds
  • Unit Group - Pick every unit in GroupVar and do (Unit - Unhide (Picked unit))
  • Custom script: call DestroyGroup(udg_GroupVar)
It's basically the same in this example, but it matters in my map, so, yeah...
Thanks for answers
 
If you use Wait action, you need variable and the 2nd way.

But if you don't use Wait, you can make it easier, without variable:
  • Unit Group - Pick every unit in every unit in (Playable Map Area) and do (Unit - Hide (Picked unit))
  • Custom script: call DestroyGroup( GetLastCreatedGroup() )
And the 1st trigger you wrote won't work like this at all. Becouse you can't do smth with destroyed group.
(In your example you destroy it, and then unhide units in destroyed group. It's impossible).
 
Status
Not open for further replies.
Back
Top