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 / How exactly does the "random" condition work?

Author
Message
itsPeaceSimon
2
Years of Service
User Offline
Joined: 13th May 2022
Location:
Posted: 16th May 2024 06:09
I'm working on an in-detail document on how Slender works in Slenderman's Shadow, and for one of his mechanics, it involves explaining how the "random" condition works.

Example from "random.fpi", the script used for the random player spawns in the Claustrophobia map


There are four possible locations for the player to spawn at, and all of them function.

Ched80's FPSC Syntax List PDF:
"RANDOM=X is true when a random number between 0 and X equals 0, i.e. random=1 gives a 50% chance of being true, whereas random=100 gives a 1% chance of being true."
If this was the case, startloc4 would've been true 100% of the time and therefore always spawn the player in location 4.

WikiBooks FPI Script article:
"RANDOM=X is true when a random value between 0 and X is equal to one"
If this was the case, startloc4 would've been true 0% of the time and therefore never spawn the player in location 4.

Not only am I confused why "random=0" has neither a 100% or 0% chance of being true, but I'm also unsure of how the following works:

From "random_chase.fpi" the script that triggers the chase mechanic, added in the Elementary map

This script also uses "random", but with the values 3, 5, 6 and 7. How exactly does that work? Does it just pick a random number out of each value of random (i.e., randomly pick either 3, 5, 6 or 7)?

Other than that, I have a decent understanding of how everything else should work.
itsPeaceSimon
2
Years of Service
User Offline
Joined: 13th May 2022
Location:
Posted: 17th May 2024 09:15
I did some testing and it seems like it just disregards "random=0" and executes the rest of the code on that line as intended.

Login to post a reply

Server time is: 2024-11-17 20:29:36
Your offset time is: 2024-11-17 20:29:36