• 🏆 Texturing Contest #33 is OPEN! Contestants must re-texture a SD unit model found in-game (Warcraft 3 Classic), recreating the unit into a peaceful NPC version. 🔗Click here to enter!
  • It's time for the first HD Modeling Contest of 2024. Join the theme discussion for Hive's HD Modeling Contest #6! Click here to post your idea!

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