[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