Not using used random values
#1

Alright, here is something I was wondering about
Let's say I am making an act, which every player is spawned in a random position out of X positions, and I don't want two players to spawn in the same location, how can I prevent this ?
Reply
#2

You could (if positions are stored in an array)
- mark the already taken locations and reroll (not recommended)
- only randomize location which haven't been taken (remove already taken locations from the array)
- shuffle the complete array beforehand
Reply
#3

Use y_iterate, init the values, use Iter_Random and remove them from the list once someone has spawned there.

Or, just use a variable to store used spots.
Reply
#4

Quote:
Originally Posted by Marricio
Посмотреть сообщение
Use y_iterate, init the values, use Iter_Random and remove them from the list once someone has spawned there.

Or, just use a variable to store used spots.
I have already thought about what you have suggested, I made the thread to see if there are any other options, anyways, thanks both
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)