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

Any way to count units selected by player?

Status
Not open for further replies.
Level 12
Joined
Apr 16, 2010
Messages
584
You mean like this:
  • Untitled Trigger 001
    • Events
      • Player - Player 1 (Red) Selects a unit
      • Player - Player 2 (Blue) Selects a unit
      • Player - Player 3 (Teal) Selects a unit
      • Player - Player 4 (Purple) Selects a unit
      • Player - Player 5 (Yellow) Selects a unit
      • Player - Player 6 (Orange) Selects a unit
      • Player - Player 7 (Green) Selects a unit
      • Player - Player 8 (Pink) Selects a unit
      • Player - Player 9 (Gray) Selects a unit
      • Player - Player 10 (Light Blue) Selects a unit
      • Player - Player 11 (Dark Green) Selects a unit
      • Player - Player 12 (Brown) Selects a unit
    • Conditions
    • Actions
      • Set Integer[(Player number of (Triggering player))] = (Number of units in (Units currently selected by (Triggering player)))
?
 
Level 20
Joined
Jul 6, 2009
Messages
1,885
  • Set Integer[(Player number of (Triggering player))] = (Number of units in (Units currently selected by (Triggering player)))

That leaks.
Do it like this:
  • Set TempGroup = (Units currently selected by (Triggering player))
  • Set Integer[(Player number of (Triggering player))] = (Number of units in TempGroup)
  • Custom script: call DestroyGroup(udg_TempGroup)
 
Status
Not open for further replies.
Top