HomeUser Control Panel (unavailable in archive)ForumsTutorialsArt GalleryResourcesMaps

Unit Group Arrays?

09-23-2002, 12:17 AM#1
Guest
Has anyone gotten *arrays* of Unit Groups to work?

I took a very simple, working trigger, and replaced a my variable this_unit_group variable with unit_group_array[0], and it stopped working altogether.

If anyone has any experience with arrays of Unit Groups, I'd really appriciate a shove in the right direction, or the confirmation of a peer that this just doesn't work.

Thanks in advance!
09-23-2002, 01:00 AM#2
Guest
You need to intialize Unit and Player Group arrays with a Set Variable action before you can add units to it with Unit Group - Add unit.

So, if you just want to start with blank groups you can use

Set GroupArray[1] = Units in playable map area matching (True equal to false)
Set GroupArray[2] = Units in playable map area matching (True equal to false)
Etc.

Or you can actually use a condition that will pick the units you want instead.
09-23-2002, 02:50 AM#3
Guest
Thanks! You rock! Works like a charm! :)

I thought I could just use the Unit Group - Add Unit action, but it seems that when you're working with Arrays of Unit Groups you need to actually set the variable explicitly first, as you illustrated.