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

Empty unit group action?

Status
Not open for further replies.
Level 14
Joined
Aug 8, 2010
Messages
1,022
Hello! In my trigger i have a group and then i destroy it via custom script. The problem is that i can't find the action "Set HitUnits [this is a unit group variable] = Empty unit group". I am SURE there was an action like this, but i can't find it... The reason i need it is because if i don't do this, the group is destroyed by the custom script on the first run of the trigger and it... "never comes back to life" (i can't use it again). :D

And by the way - will this group leak (will something leak at all) if i do this :
  • Unit Group - Remove all units from HitUnits
:confused:

  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
    • If - Conditions
      • (You help me) Equal to True
    • Then - Actions
      • Unit - Give rep (Helping unit)
    • Else - Actions
      • Do nothing
 
Level 10
Joined
Jun 6, 2007
Messages
392
If I understood correctly, there is no such action to my knowledge. How I have usually gone around this problem, is for example

set GROUP = units in playable map area matching (true == false), which results in an empty group.

This isn't really a good solution, it's rather avoiding the problem instead of solving it, but it works.
 
Level 14
Joined
Aug 8, 2010
Messages
1,022
Yes, yes, i know. By
i have a group and then i destroy it via custom script
i meant that i destroy that group with this
  • Custom script: call DestroyGroup(udg_HitUnits)
But the reason i asked for the "Set HitUnit = Empty unit group" action is that after i use
  • Custom script: call DestroyGroup(udg_HitUnits)
on the first run of the trigger, the second run of the trigger can't use the group because it is destroyed and because i haven't set it's variable.

I have another group that is set like this :
  • Set UnitGroup = (Units within 200.00 of TargetPos matching ((((Matching unit) belongs to an ally of (Owner of (Triggering unit))) Equal to False) and (((Matching unit) is alive) Equal to True)))
and then i clear that group via
  • Custom script: call DestroyGroup(udg_UnitGroup)
but i don't have that problem because i set the variable of the unit group with
  • Set UnitGroup = (Units within 200.00 of TargetPos matching ((((Matching unit) belongs to an ally of (Owner of (Triggering unit))) Equal to False) and (((Matching unit) is alive) Equal to True)))
Do you understand my problem?
 
Status
Not open for further replies.
Top