HomeUser Control Panel (unavailable in archive)ForumsTutorialsArt GalleryResourcesMaps

Setting regions into an array

03-08-2004, 02:12 AM#1
Pesmerga
Is there anyway to pick all regions and then set them as a array? Sort of like what you can do with units as follows

DetermineUnit
Events
Time - Elapsed game time is 0.01 seconds

Actions
Unit Group - Pick every unit in (Units owned by Player 2 (Blue)) and do (Actions)
Loop - Actions
Set ArrayInt = (ArrayInt + 1)
Set Guard[ArrayInt] = (Picked unit)
03-08-2004, 04:40 AM#2
Draco
If you named all your regions 1,2,3,4,5,6, you could do a "For integer A" and convert......right? :P

Not positive because I've never tried that before.
03-08-2004, 02:04 PM#3
Vexorian
There is no "convert string to rect" and there isn't Pick every rects in map and do actions.

Perhaps you may want to tell us what is the objective of that idea?
03-08-2004, 08:38 PM#4
Pesmerga
Yah. Theres a whole bunch of regions and I need them to each spawn units. But I don't want to make a trigger for each region. It would be nice if I could just add every region to a "Region group" sort to speak, and spawn a unit for each region.
03-08-2004, 10:05 PM#5
Pesmerga
Well, since I doubt theres any hope with this, and theres not too many regions (20-30) I just did the follow...

RegionSet
Events
Time - Elapsed game time is 0.01 seconds
Conditions
Actions
Set Region[1] = Alerted01 <gen>
Set Region[2] = Alerted02 <gen>
Set Region[3] = Alerted03 <gen>
Set Region[4] = Alerted04 <gen>

Trigger 2
Spawn
Events
Time - Elapsed game time is 15.00 seconds
Conditions
Actions
For each (Integer A) from 1 to 4, do (Actions)
Loop - Actions
Unit - Create 1 Footman for Player 1 (Red) at (Center of Region[(Integer A)]) facing Default building facing degrees
03-08-2004, 10:59 PM#6
linkmaster23
Quote:
Originally Posted by Pesmerga
Well, since I doubt theres any hope with this, and theres not too many regions (20-30) I just did the follow...

RegionSet
Events
Time - Elapsed game time is 0.01 seconds
Conditions
Actions
Set Region[1] = Alerted01 <gen>
Set Region[2] = Alerted02 <gen>
Set Region[3] = Alerted03 <gen>
Set Region[4] = Alerted04 <gen>

Trigger 2
Spawn
Events
Time - Elapsed game time is 15.00 seconds
Conditions
Actions
For each (Integer A) from 1 to 4, do (Actions)
Loop - Actions
Unit - Create 1 Footman for Player 1 (Red) at (Center of Region[(Integer A)]) facing Default building facing degrees
Is there something wrong? It looks fine to me...
03-10-2004, 10:02 PM#7
Pesmerga
nothing wrong with it, just saying I did it to stop confusion.