I really need help!

Liutenantpickle

Level 2
I really need help!

Anyone knows how to make Random Spawn points on
Multiple Regions?

Frotty

Level 21
There are all the functions in GUI you need.
An idea would be to store all Regions into an array, then get a random integer between 0 and the number of rects you stored.
Now that you got your random Region, you use GetRandomPoint in Rect and- voila, random point in random Rect.

Liutenantpickle

Level 2
I am so sorry.. I'm just a noob in World edit. D: Can you please explain it to me a basicER way?

Frotty

Level 21
Okay, create a region Array:

Then use a random Region by Choosing a random index for the array.

• Actions
• Unit - Create 1 Footman for Player 1 (Red) at (Random point in Region_Array[(Random integer number between 0 and 3)]) facing Default building facing degrees
You also have to set the Regions before in some init trigger, but I think you can do that.

Liutenantpickle

Level 2
Umm.. I have 16 regions for the Spawn points.
Does it have to be [(Random integer number between 0 and 16)] ?

defskull

Level 33
Yes.
RegionArray[Random integer between 0 and 16]

Liutenantpickle

Level 2
Hmm.. It doesn't work for me. It keeps respawning in the middle of the map. any solution?

rysnt11

Level 17
is your region array set like this?
• Set spawnreg[1]=region001
• ...
• Set spawnreg[16]=region016
If that so, then use random integer number from 1 to 16

defskull

Level 33
Make sure 0 and 1 is different
Your array start from what number and ends from what number ?
If you have 16 regions and the starting number is [1], your last number would be [16]
But if you start at [0], your last number would be [15]

rysnt11

Level 17
0 in array count as one array
So if you have 0 to 19 array, then you have 20 array

defskull

Level 33
I don't meant the difference between "quantity", what I meant was difference in "array referencing" where you should do math random number between 0 ~ 16 but instead, you did 1 ~ 16, it's wrong (this situation occurs if your starting array number is [0], if it's [1], it should work fine)

Liutenantpickle

Level 2
Hmm.. Does the "Action Trigger" comes after the "Set Spawn point" or Before?
I'm confused @-(

Level 36
the set spawn points are better done on the map init trigger...

Replies
2
Views
2K
Replies
14
Views
653
Replies
7
Views
373
Replies
2
Views
461
Replies
4
Views
484