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

[Solved] Will 'pick every unit -and do- remove picked unit from the game' cause a leak?

Status
Not open for further replies.
Level 7
Joined
Nov 10, 2010
Messages
87
I definitely don't want any leaks because my triggers often repeat themselves throughout the game.

It's just I noticed normal unit groups only seam capable of containing 12 units at a time and I tested this trigger and it can do whole armies. But it seams to not be able to do an infinite amount of units either, not sure. I wonder how many units it can do, anyone know? Doesn't matter if it leaks so that's more important, does it leak???

Will these triggers circled in red cause a leak?
NOTE: I attached the level too.
View attachment 277721
 
Level 15
Joined
Aug 31, 2009
Messages
776
You need to do something more like

Set (GroupVariable) = Units of Type [MyUnitType]

Then do actions on that group.

Lastly, do: Custom script: call DestroyGroup(udg_GroupVariable)


Easier still, just do something like this:
  • Set GrouptoRemove = (Units owned by (Player 1 (Red)))
  • Unit Group - Pick Every Unit in (GrouptoRemove) and do (Actions)
    • Loop - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • Or (Any Conditions are True)
            • Unit-Type of Picked Unit equal to English Captain 1
            • Unit-Type of Picked Unit equal to English Captain 2
            • Unit-Type of Picked Unit equal to .... (etc.)
            • ....
        • Then - Actions
          • Unit - Remove (Picked Unit) from the game.
        • Else - Actions
  • Custom script: call DestroyGroup(udg_GrouptoRemove)
 

Rheiko

Spell Reviewer
Level 27
Joined
Aug 27, 2013
Messages
4,220
You can also do it like this

  • Custom script: Set bj_wantDestroyGroup = true
  • Unit Group - Pick Every Unit in (Units owned by (Player 1 (Red))) and do (Actions)
    • Loop - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • Or (Any Conditions are True)
            • Unit-Type of Picked Unit equal to English Captain 1
            • Unit-Type of Picked Unit equal to English Captain 2
            • Unit-Type of Picked Unit equal to .... (etc.)
            • ....
        • Then - Actions
          • Unit - Remove (Picked Unit) from the game.
        • Else - Actions
 
Status
Not open for further replies.
Top