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

whats the best method to use?

Status
Not open for further replies.
Level 13
Joined
Mar 24, 2010
Messages
950
whats the best way to make this group then remove it for leaks

  • Set Temp_PlayerGroup = (All players matching (((Name of (Matching player)) Equal to PlayerName) or (((Name of (Matching player)) Equal to PlayerName2) or (((Name of (Matching player)) Equal to PlayerName3) or ((Name of (Matching player)) Equal to PlayerName4)))))
or like this

  • Player Group - Pick every player in (All players) 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
            • Conditions
              • (Name of (Picked player)) Equal to PlayerName
              • (Name of (Picked player)) Equal to PlayerName2
              • (Name of (Picked player)) Equal to PlayerName3
              • (Name of (Picked player)) Equal to PlayerName4
        • Then - Actions
          • Player Group - Add (Picked player) to Temp_PlayerGroup
        • Else - Actions
then at the end of what im doing remove with this
call DestroyForce(udg_Temp_PlayerGroup)

for the sake of it being easier to add names i would like to be able to use the 2nd one but does that work the same way as the first for destroying a player group to clean leaks?
Or if i do it the 2nd way does the group even need to be cleaned if i just use
  • Player Group - Remove all players from Temp_PlayerGroup
?
 
Level 13
Joined
Mar 24, 2010
Messages
950
good i like the 2nd one better for editing anyway :)

I would use the All Players option since the first one leaks, you can't prevent that in GUI.
i thought call DestroyForce(udg_Temp_PlayerGroup) removed the leak

also i guess i could just make this a perma player group even thought its not fully needed.. but doesnt a player group leak when you make 1 or add players to it? it will take up that memory that whole game right? i understand how temp groups work but what about perma groups that are made?
 
Level 37
Joined
Mar 6, 2006
Messages
9,243
  • Custom script : call GroupEnumUnitsInRange(bj_lastCreatedGroup, x, y, radius, null)
  • Unit Group - Pick every unit in (Last created unit group) and do (Actions)
    • Loop - Actions
      • Set unit = (Picked unit)
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (unit is dead) Equal to False
          • (unit is A structure) Equal to False
        • Then - Actions
        • Else - Actions
 
Status
Not open for further replies.
Top