HomeUser Control Panel (unavailable in archive)ForumsTutorialsArt GalleryResourcesMaps

Selecting a single unit from a unit group

03-08-2007, 08:50 PM#1
Castlemaster
In my map, I have monsters set their targets to variables for trigger-driven AI reasons. The problem is that while they have a single hero as their target, it periodically (like every 0.2 seconds) takes all nearby units that are enemies of that monster and stores them in a unit group . I want the units to not be given a new command (i.e. keep attacking uninterrupted) if one of the nearby units stored to the unit group is their current target. So my question is, what "if" statement tells me if a single unit is in a unit group ?
03-08-2007, 09:06 PM#2
moyack
In jass you can use this native.

Collapse JASS:
constant native IsUnitInGroup       takes unit whichUnit, group whichGroup returns boolean

If you are a GUI user, you can find this instruction in a boolean comparison.
03-09-2007, 12:03 AM#3
Castlemaster
D'oh, I glossed over it in GUI, thanks though