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

Unit Groups

Status
Not open for further replies.
Level 2
Joined
Feb 13, 2008
Messages
11
Could somebody explain the use of Unit groups and how they work? I am trying to make a trigger where a bunch of units die are the condition of the trigger. How do I select units for a unit group?
 
Level 9
Joined
Oct 17, 2007
Messages
547
Make a UnitGroup variable and add units to it

For example:
Set TempUnitGroup = Units in YourTown<gen> owned by Player 1(Red)

Then for checking if every unit in that group is dead you can use:
  • Events -
  • Unit - A unit Dies
  • Conditions -
  • All units of TempUnitGroup are dead
  • Actions -
  • Set Point = (Position of (Triggering Unit))
  • Item - Create Reward at Point
  • Custom script: call RemoveLocation(udg_Point)
That create the Item Reward at the location where the last unit of that group died.
Point - a location variable
Reward - some type of item
TempUnitGroup - a unit group variable
YourTown - some region in the map (draw it using WE)
 
Level 9
Joined
Oct 17, 2007
Messages
547
-Go to Variables (the button that has a yellow X)
-Press the green "+X"
-Give it a name
-Select Unit Group from the scroll down menu
-Then click Ok

I already showed you the function for adding units into a group variable above
 
Status
Not open for further replies.
Top