GetRandomPercentSeeded

From GECK
Jump to: navigation, search


A function added by the ShowOff NVSE Plugin.

Description

Returns a random number between 1-100, which is based upon the randomizer seed set for the calling mod.

Note that GetRandomPercent generates from 0-99.

If no seed is set for the calling mod, this first generates a default seed (value of 5489).

  • NOTE: since the default seed is constant, it will always generate the same sequence of random numbers.

(Behind the scenes, this advances the seed's internal numGenerated count so as to make the next call of RandSeeded/GetRandomPercentSeeded generate the next number in the pseudo-random sequence.)

Syntax

[help]
(randomPerc:int) GetRandomPercentSeeded

Example

int iPercent
let iPercent := GetRandomPercentSeeded  ; * equivalent to using `RandSeeded 1, 100`

For example above, if a seed was not initialized prior with SetRandomizerSeed / SetSeedUsingForm, will generate random values using the default seed.

See Also