choosing only "x" number of origin to spawn
hii,
i am spawning an enitity using this code to any Origin PHP Code:
Code:
323 -1007 67 i don't wanna spawn my enitity to all 10 ORIGINS :nono: , it can choose any 6 random origins from 10 origins from file THANKS IN ADVANCED !! :wink: |
Re: choosing only "x" number of origin to spawn
You buffer and randomize.
Code:
Code:
Code:
If you want it dynamic and editable by the end user don't forget to check that there are more locations than requested spawns. Code:
|
Re: choosing only "x" number of origin to spawn
Quote:
|
Re: choosing only "x" number of origin to spawn
In the second example I made a mistake:
spawn_testing(vOrigin[temp][i], szDesc) should be spawn_testing(vOrigin[temp], szDesc) Also noticed now that you're using the szDesc which i ignored. I've updated both the examples. The difference between the 2 examples is that example 1 looks like shit but it might be slightly more random. I would use example 2. Sorry about that. |
Re: choosing only "x" number of origin to spawn
Quote:
it is also easier |
Re: choosing only "x" number of origin to spawn
SOLVED ,
thanks @blackrose i tested both are working @Nova yes bro , i use second method |
Re: choosing only "x" number of origin to spawn
Sorry, I haven't been coding for a while...
I made a bitwise mistake in the second code. Code:
Code:
Let's for example take temp = 3 as an example. In the first code it would just add 3 to the bitsum resulting in: Code:
00000000 00000000 00000000 00000011 Here's why it's wrong using vOriginUsed = 3 and new temp = 1: Code:
00000000 00000000 00000000 00000011 (vOriginUsed |= 3) Code:
00000000 00000000 00000000 00001000 (vOriginUsed |= (1<<3)) |
All times are GMT -4. The time now is 12:54. |
Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.