GetRandomPercent

From The Elder Scrolls Construction Set Wiki

Syntax:

GetRandomPercent 

Returns a random number from 0-99 inclusive.


To generate a random number between min and max:

set randVal to min + GetRandomPercent * (max-min) / 99

Examples:

short dice
set dice to 1 + 0.06 * GetRandompercent  ;  => 1 to 6 (almost equal chances see talk page)
short rnd
set rnd to 5.0/99 * Getrandompercent     ;  => 0 to 5 (only 1% chance for 5! see talk page)
float rnd
set rnd to 0.05 * Getrandompercent       ;  => 0.00 to 4.95 
float rnd
set rnd to 5/99 * Getrandompercent       ;  => 0.00 to 5.00 

[edit] See Also

Personal tools