HomeUser Control Panel (unavailable in archive)ForumsTutorialsArt GalleryResourcesMaps

About regions question?

12-20-2003, 08:03 PM#1
PatruX
Okay, It's like this:

I have a barrack.
And 3 Regions.

When I build a unit in the barrack he will get teleported to one random region (of those 3).

How to do so? :////
12-20-2003, 08:11 PM#2
Ligature
This is a much abstracted version of what you will probably want to do:

-Set RandomInteger = random integer between 1 and 3
-If RandomInteger = 1 then teleport to TheRegionICallNumberOne
-If RandomInteger = 2 then teleport to TheRegionICallNumberTwo
-If RandomInteger = 3 then teleport to TheRegionICallNumberThree
12-20-2003, 08:47 PM#3
chemo
Variables:
Region (region) Array:yes
Spawn (Integer) Array:no


trigger1
E: Map Ini
C:
A:
Set Region[1]=region01
Set Region[2]=region02
Set Region[3]=region03
Set Spawn=0

trigger2

E: A unit is trained
C: Selling unit equal to Barrack
A:
Set Spawn=random Integer between 1 to 3
Move trained Unit instantly to Region[Spawn]


thats the easyest way to make it.. ( i think)
12-22-2003, 12:38 AM#4
[Death]
Quote:
Originally posted by Ligature
This is a much abstracted version of what you will probably want to do:

-Set RandomInteger = random integer between 1 and 3
-If RandomInteger = 1 then teleport to TheRegionICallNumberOne
-If RandomInteger = 2 then teleport to TheRegionICallNumberTwo
-If RandomInteger = 3 then teleport to TheRegionICallNumberThree


Where ARE the triggers for them? I can never find them! :////
12-22-2003, 04:13 PM#5
Ligature
Yeah if you're dealing with a whole bunch of regions, I would definitely choose Chemo's route... I just figured, with only 3 regions, you'd be better off without the region array.

Pure_Death: it's just a "set variable" action, using the "Math - random integer" function.