HomeUser Control Panel (unavailable in archive)ForumsTutorialsArt GalleryResourcesMaps

Variable Array?

09-21-2002, 11:53 PM#1
Guest
I've had a series of spawning triggers that generated a random creep of a certain level. However, there are no level 8 creeps on the Lordaeron tileset, and other levels have only a few varieties. Since I want a greater spread of creature types at each level, I created specific unit groups. However, when I decided to do it for each level, I changed from specific unit group variables, to one array. But now, though the syntax is the same, I'm getting null in the variable, and so nothing spawns.

Here is a sample:

Variable: Unit Group - Add (Random unit from (Units of type Bandit)) to DaySpawningPool[1]

Trigger: For each (Integer A) from 1 to 2, do (Unit - Create 1 (Unit-type of (Random unit from DaySpawningPool[1])) for Neutral Hostile at (Random point in SpawnLocations[(Integer A)]) facing (Position of Way Gate 0005 <gen> ))

Nothing seems to get put into the variable array, or at least nothing will echo out of it, and certainly nothing spawns. I'd like to be able to use the array for simplicity, and also because I could eliminate multiple spawning triggers where I could simply use another variable for the array location.

I'll attach the map, if you would like to look at it specifically. I'd love some help though, because I'm stumped. As far as I can see, it should be working, but obviously is not.
09-22-2002, 01:51 AM#2
Guest
IIRC, a Unit Group is a group of real, existing Units, not a group of Unit Types.

It looks like you're trying to add all the Bandit Units anywhere on the map to your Unit Group. Are there any existing Bandits on your map?
09-22-2002, 02:46 AM#3
Guest
No. But I tried just a small array of units that I did have on the map, and it didn't work for me either.

What I want is to spawn types of units. I don't want to have the types necessarily on the map already.

How do I create a group array of unit types then? I did have it working before, but I wasn't using an array. But it shouldn't have made any difference, unless the variable needs to be different than it is.
09-22-2002, 07:56 AM#4
Guest
Create a Unit-Type array and then at initialization fill it up

Set CreepTypeArray[1] = Unit-Type Bandit

Or however it looks. When you go to set it, it'll pop up with the unit portrait dialog, just like if you were choosing a unit to create.

Then you can do what you did to create the unit.
09-23-2002, 08:33 PM#5
Guest
Thanks, DrunkOM.

That seems to have done it.