| 12-18-2003, 05:29 PM | #1 |
can i make a variable that includes 9 regions so i can create 2 units at each region without having to say "create 2 footmen at region001" 9 times? so it would be like "create 2 footmen in variable region" or something??? or a better question is, is there an easyer way to creat units at a lot of different regions than creating a lot of actions? |
| 12-18-2003, 06:48 PM | #2 |
You could make a region array. |
| 12-20-2003, 12:37 AM | #3 |
how can i do that? |
| 12-20-2003, 12:57 AM | #4 |
Ok, first you need to set all the regions into an array. Im using a region array named region, with the region numbers being 0-3. For each (Integer A) from 0 to 3, do (Actions) Loop - Actions Unit - Create 1 Footman for Player 1 (Red) at (Center of region[(Integer A)]) facing Default building facing degrees Its as simple as that. |
| 12-20-2003, 03:28 AM | #5 |
how do i make an array? with the regions in it? i have 9 regions, i want to create 2 footmen in each. i labled the regions 1-9, and put in the actions u just put and they didnt work. |
| 12-20-2003, 03:41 AM | #6 |
When you make a variable you can turn it into an array written by checking the box with array next to it. what i mean by setting regions into the array is on map initialization have a trigger doing set variable Set Region(1) = region1 the first region being your array and the second being the actual region. do this for all regions needed. Set Region(1) = region1 Set Region(2) = region2 and so on for all 9 Set Region(9) = region9 Now for the unit creating trigger use this action For each (Integer A) from 1 to 9, do (Actions) Loop - Actions Unit - Create 2 Footman for Player 1 (Red) at (Center of region[(Integer A)]) facing Default building facing degrees |
