Random method without repeating
#10

Quote:
Originally Posted by Golimad
Посмотреть сообщение
run a random function, if the array has SpawnedAlready==false then spawn it in that position and set it true, if it has just do a while function until you find some array with false:SpawnedAlready, I hope you understood what I meant
Lets say there is only item left all other are set to true, if you are unlucky the random function will never find that number and hang your server

Quote:
Originally Posted by Detoria
Посмотреть сообщение
That sytem will not prevent them from spawn in the same coordinates,this is waht i'm trying to prevent.

I prefer that they all spawn togheter,but preventing repeated coordinates,surely that the code that i post didn't work properly ?
It will not even go past
pawn Код:
if(SelectCoord == sizeof(cCheck[i]))
because that isn't valid code

You want to randomize your easter eggs but how should they be randomized if all coordinates are used and all easter eggs look the same ?
If you only want to spawn x (x < max coords) without duplicates that should be no problem
Or do you want to spawn one easter egg without using the already spawn position till all positions are used

Just explain more precise what you want
Reply


Messages In This Thread
Random method without repeating - by Detoria - 06.03.2015, 23:14
Re : Random method without repeating - by Golimad - 06.03.2015, 23:25
Re: Re : Random method without repeating - by Detoria - 06.03.2015, 23:27
Re : Random method without repeating - by Golimad - 06.03.2015, 23:30
Re: Re : Random method without repeating - by Detoria - 06.03.2015, 23:32
Re : Random method without repeating - by Golimad - 06.03.2015, 23:38
Re: Random method without repeating - by Detoria - 06.03.2015, 23:45
Re : Random method without repeating - by Golimad - 06.03.2015, 23:52
Re: Random method without repeating - by Detoria - 07.03.2015, 00:18
AW: Re : Random method without repeating - by Nero_3D - 07.03.2015, 00:21

Forum Jump:


Users browsing this thread: 2 Guest(s)