Chapter 3
by gene.sis
_
Conditional Branches - Creating Random Numbers
You can use Random Numbers for Score Changes.
-
General
You can use Random Numbers in calculations with variables of the types Numerical and Progress.
When performing a Score Change, you can use a Random Number instead of a fixed number.
The Random Number can be added ("+") or subtracted ("-") from a variable or the variable can be set ("=") to the Random Number. -
Usage
To make the number operand of a Score Change a Random Number, precede it with an "R".
The minimum value of a Random Number is always 0.
The maximum value of a Random Number is the number after the "R".
Example: A Random Number "R3 will result in a random value between 0 and 3, including 0 and 3. So the possible result might be 0, 1, 2, or 3.To set a variable to a Random Number, create a Score Change
variable = Rn
, using a number forn
.
Example: Score Change ofRandom = R3
will set the variable "Random" to 0, 1, 2, or 3.To add a Random Number to a variable, create a Score Change
variable + Rn
, using a number forn
.
Example: The variable "Random" has currently a value of 10. A Score Change ofRandom + R3
will change the variable "Random" to a value between 10 and 13, including 10 and 13. So the possible result of "Random" might be 10, 11, 12, or 13.To subtract a Random Number from a variable, create a Score change
variable - Rn
, using a number forn
.
Example: The variable "Random" has currently a value of 10. A Score Change ofRandom - R3
will change the variable "Random" to a value between 7 and 10, including 7 and 10. So the possible result of "Random" might be 7, 8, 9, 10. -
Maximum Input Values
The maximum input value for Random Numbers is determined by the variable type.
For Numerical variables, the maximum input value is R100000.
For Progress variables, the maximum input value is R100. -
Example of Simulating a Dice Roll
The minimum value of a Random Number is always 0, so it might be necessary to adjust your calculations to get the desired result.Simple dice roll of a six-sided dice:
dice_roll = 1
sets the variable to 1
dice_roll + R5
adds 0 to 5, so the result will be 1, 2, 3, 4, 5, or 6Modified dice roll like D6+2:
dice_roll = 1
sets the variable to 1
dice_roll + R5
adds 0 to 5, so the result will be 1, 2, 3, 4, 5, or 6
dice_roll + 2
adds 2, so the result will be 3, 4, 5, 6, 7, or 8
Modified dice roll like D6+2 (simplified):
dice_roll = 3
sets the variable to 3 (combines the two Score changes of =1 and +2)
dice_roll + R5
adds 0 to 5, so the result will be 3, 4, 5, 6, 7, or 8
Modified dice roll like D6+2 (simplified, alternative version):
dice_roll = R5
sets the variable to 0, 1, 2, 3, 4, or 5
dice_roll + 3
adds 3, so the result will be 3, 4, 5, 6, 7, or 8Multiple dice roll, like 2D6:
dice_roll = 2
sets the variable to 2
dice_roll + R5
adds 0 to 5, so the result will be 2, 3, 4, 5, 6, or 7
dice_roll + R5
adds 0 to 5, so the result will be 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, or 12
Using two Score Changes with Random Numbers ensures that the distribution of the numbers will be the same as with a regular roll of two dice. I.e. from 36 six dice rolls this set of Score Changes will statistically return the results 2 one time (2.78%), 3 two times (5.56%), 4 three times (8.33%), 5 four times (11.11%), 6 five times (13.89%), 7 six times (16.67%), 8 five times (13.89%), 9 four times (11.11%), 10 three times (8.33%), 11 two times (5.56%) and 12 one time (2.78%).
_
- No further chapters
Disable your Ad Blocker! Thanks :)
CHYOA GUIDE
This is all you need to know
- All Comments
- Chapter Comments