HomeUser Control Panel (unavailable in archive)ForumsTutorialsArt GalleryResourcesMaps

Unit Group Array Q

01-29-2003, 07:36 AM#1
Hivemind
When we use the function ..

Add picked unit to Group[1]

It never adds the unit to the group. If we use add last created unit it works. But that wont work for all cases. If we make a list of seporate non array groups it works fine. But that becomes a problem when we try to use a large number of groups or we dont know how many groups (or indexes) will be used in a game. If we use a another type of array they work fine so it isnt a error in another part of the trigger. We even tested it by posting a message that lists the units in each array. The same trigger would add to a unit group but not a array group. So why wont unit group arrays work? This has caused us a lot of problems since we use a lot of random effects and manipulation of unit groups in our maps.

For example we have a function in our TD tha picks a random Trade Center (player built building) and gives a random unit or resource to the owning player. We made it work but we had to remove the building from game once built and create a new one in its place. Then add the newly created unit to the unit array via last created unit. Each index number represented only one Trade Center. Then use a random number for the index to chose a random Trade Center. This worked for that aplication (dont ask how long we spent trying to figure out how to make that work) but we have other aplications we want to put into maps that could only be easily done by adding a unit to a group array. A pick random unit from unit group function would have worked for that aplication but not for others we want to do.

We are having this problem again on our new map. This is the third time the lack of using this function has been a major problem for us. We are getting tired of finding work arounds for this. Since every aplication we want to use it for is a little different we cant just use the work arounds we have already figured out. Anyone know how to add a unit to a array as easily as you can to a non array group?
01-29-2003, 10:48 AM#2
AIAndy
The problem is that WE does not initialize unit group arrays properly. You have to do it yourself with custom text. Just search for unit group arrays and you should find the solution. It has been asked some days ago.
01-30-2003, 04:25 AM#3
Guest
Hi. I just had the same problem ://// and managed to finally fix it (at least as far as I know) thanks to the help from other people on the forum.

The thread can be found at: http://wc3campaigns.com/forums/showt...9148#post89148

If you have specific questions, I will respond ASAP. Hope the thread is easy enough to understand. Good luck.
01-30-2003, 08:50 AM#4
Hivemind
Figured it was a editor bug. Thnx guys we will take a look at that thread.