Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

FPSC Classic Scripts / RANDOMIZE- how it work?

Author
Message
Corno_1
14
Years of Service
User Offline
Joined: 3rd Nov 2010
Location:
Posted: 17th Oct 2012 17:35
hello community,
i want to improve my scripting skills so i look in cheds unofficial command syntax list and found the "randomize" command.
he explain it so:

but how do i apply this, before the random=x command or behind? what did it? i know that it randomize the random command with the timer, but how he did that, because the random command is definied so:


if some can help me, that would be nice!
If i understand this maybe this help me with my "ai vs plr" script, which of course i not want to hide when it is finished.

Corno

Fenwolf
13
Years of Service
User Offline
Joined: 24th Oct 2011
Location: United States
Posted: 19th Oct 2012 01:49
If I remember my programming days properly, this is how it works:

Random can generate the same random number under certain conditions and at certain times during the running of a program or script. An example would be that at an exact given time in the game, the random number could generate the same upon multiple executions of the script or game. Randomize helps to assure that the random number is more random. This is done with a seed, in this case the timer.

Randomize should be used before the use of a random number generator to assure greater randomness. Hope this helps.

Life is about living.
Pirate Myke
14
Years of Service
User Offline
Joined: 31st May 2010
Location: El Dorado, Ca
Posted: 19th Oct 2012 05:39
Here is a perfect example of the random condition. This is from one of the zombie scripts from Bond1 character.




Probably one of the best examples.

Corno_1
14
Years of Service
User Offline
Joined: 3rd Nov 2010
Location:
Posted: 19th Oct 2012 15:17
thank you all! that help a lot.

watch the script thread for my enemy script

Login to post a reply

Server time is: 2024-11-23 19:19:34
Your offset time is: 2024-11-23 19:19:34