• 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.
  • It's time for the first HD Modeling Contest of 2025. Join the theme discussion for Hive's HD Modeling Contest #7! Click here to post your idea!

[General] Two Questions on Unit Groups

Status
Not open for further replies.
Level 4
Joined
May 20, 2011
Messages
59
Hey Guys,
How do you create a Unit Group through a Custom Script/JASS? And also, is it possible to check if a Unit Group is Empty and if so how would both of these things be accomplished through Triggers? Thanks so much!
Cordially,
Adorm
 
Level 16
Joined
Mar 25, 2016
Messages
1,327
This creates an empty group:
JASS:
local group g = CreateGroup()
If you want to pick units in range of a point you can use:
JASS:
call GroupEnumUnitsInRange(g,x,y,radius,null)
To check if group g is empty you can check:
JASS:
if(FirstOfGroup(g)==null) then

endif
 
Level 4
Joined
May 20, 2011
Messages
59
This creates an empty group:
JASS:
local group g = CreateGroup()
If you want to pick units in range of a point you can use:
JASS:
call GroupEnumUnitsInRange(g,x,y,radius,null)
To check if group g is empty you can check:
JASS:
if(FirstOfGroup(g)==null) then

endif
Is it possible to check if the group is empty through a normal GUI Function?
 
Status
Not open for further replies.
Top