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 / Randomness

Author
Message
lilgamz
18
Years of Service
User Offline
Joined: 10th Mar 2006
Location:
Posted: 26th Jun 2006 18:15
Is there a random number generator in fpsc script?

Can we get access to clock perhaps? For example the microseconds?

That might be "random" enough
Les Horribres
19
Years of Service
User Offline
Joined: 20th Nov 2005
Location: My Name is... Merry
Posted: 26th Jun 2006 18:18
no there is not. You see, a computer is literally incapable of creating a truely random sequence thus you have a string of numbers that will inevidably repeat themselves.

but you could do :random=(maxrandom):

Your Mod was deleted by the Government.
One can only know so much, only comprehend the world to a point. After that we exist as impressionable beings. Doing nothing, being nothing, forever nothing.
lilgamz
18
Years of Service
User Offline
Joined: 10th Mar 2006
Location:
Posted: 26th Jun 2006 19:32
And what about the clock? The millisecond value could be a fairly random event.
Tom0001
18
Years of Service
User Offline
Joined: 30th Dec 2005
Location:
Posted: 28th Jun 2006 01:21
Yes, the computer's clock can be used to generate a random number!

Tom

lilgamz
18
Years of Service
User Offline
Joined: 10th Mar 2006
Location:
Posted: 28th Jun 2006 10:38
So how could that work?

How can you assign a variable name to say, the last millisecond,
then tell the game if x<5 have this character do this>?

Sorry if its a dumb question but Im new to scripting and havent played with it much.
xplosys
18
Years of Service
User Offline
Joined: 5th Jan 2006
Playing: FPSC Multiplayer Games
Posted: 28th Jun 2006 16:15
I'm not sure, but I don't think you can access the computers clock from within FPSC. If you can, I don't know of the command.

While the computers clock is not random, it can be used as a starting point to generate a near-random number by adding the current clock value to a program random. Because it uses fractions of a second after midnight to keep time throughout the day, it is unlikely that any player will do the same thing at exactly the same fraction of a second after midnight as another player, therefore making it nearly-random. Eventually, everything repeats so there is no real random as far as computers are concerned.

Sorry for the long qualification, but some people like to come behind the conversation and make corrections.

Crazy Grandpa
Les Horribres
19
Years of Service
User Offline
Joined: 20th Nov 2005
Location: My Name is... Merry
Posted: 29th Jun 2006 07:59
I gave you the command


:random=(maxrandomnumber):Build=REALLYCOOLGAME

Your Mod was deleted by the Government.
lilgamz
18
Years of Service
User Offline
Joined: 10th Mar 2006
Location:
Posted: 29th Jun 2006 16:22
ok. It think i get it now. thanks merranvo.

Login to post a reply

Server time is: 2024-11-22 15:13:06
Your offset time is: 2024-11-22 15:13:06