• 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.
  • The Hive's 22nd Icon Contest: Creep Abilities is now concluded, time to vote for your favourite set of icons! Click here to vote!
  • ✅ The POLL for Hive's Texturing Contest #34 is OPEN! Vote for the TOP 3 SKINS! 🔗Click here to cast your vote!
  • ✅ The POLL for Hive's Techtree Contest #20 is OPEN! Vote for the TOP 3 FACTIONS! 🔗Click here to cast your vote!

[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
 
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)
 
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.
Back
Top