[Solved] Multiple Zone Portal

Level 3
Joined
Jul 19, 2014
Messages
38
Hi there! I was looking for a way that allow me to create a portal able to teleport every unit who enters to a random zone between 15 to choose, but i don't get it, maybe someone can help me with this problem... Thanks for read! Have a nice day!
 
Level 16
Joined
Sep 26, 2009
Messages
2,022
You need to represent the locations, where you are teleported by the portal.
This can be done by:
a) Placing regions in map, then at map initialization saving each region into region array.
b) Converting the coordinates of each location into points, saving those points into point array.

Then you make trigger which fires when you are teleported and you choose a random integer number between 1 and 15 and use that random number as an index for the region/point array.

Basically:
Map ini:
loc[1] = [0,0]
loc[2] = [5,16]
loc[3] = [-15,5]
etc.

or
reg[1] = TeleportRegion<0001>
reg[2] = TeleportRegion<0002>
reg[3] = TeleportRegion<0003>
etc.

Then
Unit is being teleported (you need to figure the event yourself)
randInt = random integer between 1 and 15
Move unit to loc[randInt] / reg[randInt]
 
Top