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

quick question

Status
Not open for further replies.
Level 14
Joined
Jan 15, 2007
Messages
349
Of course playergroups leak in wrong usage because also playergroups are handles. But for example some stuff dont leak like this:
  • PlayerGroup - Pick every player in (All players) and do (Actions)
    • Loops - Actions
Because the function GetPlayersAll() returns the bj "bj_FORCE_ALL_PLAYERS", what means it wouldnt leak.
 

Rui

Rui

Level 41
Joined
Jan 7, 2005
Messages
7,550
Everything leaks except booleans, integers and reals.

To prevent the player group from leaking, you only need to do the same that you do for unit groups, but we use a different custom script (and, of course, a player group variable instead of a unit group one):
  • Actions
    • Set YourPlayerGroupVariable = (Pick Every Player...)
    • Make your actions with the variable here
    • Custom script: call DestroyForce(udg_YourPlayerGroupVariable)
 
Level 10
Joined
Sep 29, 2006
Messages
447
so like this?

  • starting resources
    • Events
      • Map initialization
    • Conditions
    • Actions
      • Set AllPlayers = (All players)
      • Player Group - Pick every player in AllPlayers and do (Actions)
        • Loop - Actions
          • Player - Add 1050 to (Picked player) Current gold
      • Custom script: call DestroyForce(udg_AllPlayers)
 
Status
Not open for further replies.
Top