HomeUser Control Panel (unavailable in archive)ForumsTutorialsArt GalleryResourcesMaps

Unit Group (array) difficult question...

06-20-2004, 04:52 AM#1
ChaosWolfs
I have this idea and it could work perfectly.

How do I make a trigger that sets Units In Region A to Unit group (1), then when Unit Group (1), becomes full, it goes to unit group (2), and etc. When one of the Unit groups become empty like 1, it goes back to number 1..
06-20-2004, 01:18 PM#2
AIAndy
What do you mean with unit groups becoming full ?
06-20-2004, 03:34 PM#3
linkmaster23
I think he means size 12. The default selection MAX. There is no Unit Group max...
06-20-2004, 08:54 PM#4
ChaosWolfs
Quote:
Originally Posted by linkmaster23
I think he means size 12. The default selection MAX. There is no Unit Group max...

What do you mean the default selection max? Im kinda confused...
And there is not unit group max? Meaning over 100 units can go in one unit group? (GruntConfused would be the perfect smily, but it don't work. Keeps giving me GruntSad) o_O

I hear people saying that the max units that can go in a unit group was 12 units. So I thought of this... Now Linkmaster totally confused me.
06-20-2004, 09:05 PM#5
johnfn
No, you can store much more than 12 units in a unitgroup. My guess is 8092, but thats just a guess. Its 2^something.

Selection max refers to how many units you can select.
06-20-2004, 11:10 PM#6
LunaSeer
Yea, the limit for a unit group variable is very high. You won't be able to fill it up. You don't need to do an array.

If you still want to use a Unit Group array, unlike other variable, you will have to specify how many arrays you want. Change that number next to the variable from 1 to whatever.
06-20-2004, 11:14 PM#7
Cubasis
Yes,

He was saying that the Selection max was 12, in-game. The thing that started this rumor/whatever, is that .... Unit-Group orders only affect the first 12 units in a group. You can guess why this is... (as it's the same thing the game uses to order your selection to do something...and in-game you only work with a maximum of 12 units at a time).

I could make a simple function for ya that orders a unit-group of any size to do something, or perhaps even WEU has it in already, who knows.

But other than unit-group orders, Unit-Groups are limitless.

~Cubasis
06-21-2004, 01:21 AM#8
ChaosWolfs
Quote:
Originally Posted by Cubasis
Yes,

He was saying that the Selection max was 12, in-game. The thing that started this rumor/whatever, is that .... Unit-Group orders only affect the first 12 units in a group. You can guess why this is... (as it's the same thing the game uses to order your selection to do something...and in-game you only work with a maximum of 12 units at a time).

I could make a simple function for ya that orders a unit-group of any size to do something, or perhaps even WEU has it in already, who knows.

But other than unit-group orders, Unit-Groups are limitless.

~Cubasis

Ok. Lets say the unit group is 12 max... I want to make a trigger that puts units in RegionRed into a Unitgroup (1). If unitgroup (1) gets to 12 units, I want the array go Plus 1 to 2. etc. Then if the array (1) gets empty, it starts over..
06-21-2004, 02:58 PM#9
LunaSeer
Why? That would be kind of stupid.

But here's how to do it:

Variables:
BigGroup - Unit Group
GroupRed - Unit Group Array (remember to do what I said in my previous post)
GroupNumber - Integer initially at 1

Code:
Trig 1 Actions:
- Pick every unit in RegionRed and add picked unit to BigGroup
- Run Trig 2
Code:
Trig 2 Actions:
- For each integerA from 1 to (Group Number - 1) run Trig 3
- If number of units in GroupRed[GroupNumber] is less than 12
   - Then pick every unit in (unit-->group (random unit in BigGroup)) and do actions
      - Add picked unit to GroupRed[GroupNumber]
      - Remove picked unit from BigGroup
   - Else set GroupNumber = GroupNumber + 1
- If number of unit in BigGroup greater than 0
   - Then run this trigger
   - Else do nothing
Code:
Trig 3 Actions
- If number of units in GroupRed[IntegerA] is less than 12
   - Then If number of units in BigGroup is greater than 0 
      - Then do actions
         - Pick every unit in (unit-->group (random unit in BigGroup)) and do actions
            - Add picked unit to GroupRed[GroupNumber]
            - Remove picked unit from BigGroup
         - Run this trigger
      - Else skip remaining actions
   - Else do nothing
Something like that. There are other ways but that's what I could think of at this time.

I don't know how you plan on doing with the groups or what events you are going to use but if you are thinking of a player's hotkey selection groups (they aren't unit group variables) then there is no way to add units to a hotkey selection group with triggers (Not that I know of).