• 🏆 Texturing Contest #33 is OPEN! Contestants must re-texture a SD unit model found in-game (Warcraft 3 Classic), recreating the unit into a peaceful NPC version. 🔗Click here to enter!
  • It's time for the first HD Modeling Contest of 2024. Join the theme discussion for Hive's HD Modeling Contest #6! Click here to post your idea!

[Solved] Multiple Zone Portal

Status
Not open for further replies.
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 25
Joined
Sep 26, 2009
Messages
2,378
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]
 
Status
Not open for further replies.
Top