Skip to content

Class "RNG"⚓︎

Modified Constructors⚓︎

RNG ()⚓︎

RNG RNG ( int seed = 2853650767, int shiftIdx = 35 )⚓︎

Now takes an optional seed and an optional shiftIdx. This can be used to avoid separating construction of the RNG object and a call to SetSeed.

The function validates both the seed and the shift index.


Modified Functions⚓︎

RandomInt ()⚓︎

int RandomInt ( int Min, int Max )⚓︎

Can now emulate math.random by accepting a second argument to generate a number between the first argument and it, inclusive. Negative values are usable in this mode and will properly generate a number between min and max regardless of sign.


SetSeed ()⚓︎

void SetSeed ( int Seed, int ShiftIdx = 35 )⚓︎

An error is now thrown if Seed is below 0.

An error is now thrown if ShiftIdx is not between 0 and 80, inclusive.

ShiftIdx is now optional, with the default value set to 35.


Functions⚓︎

GetShiftIdx ()⚓︎

int GetShiftIdx ( )⚓︎


PhantomFloat ()⚓︎

float PhantomFloat ( )⚓︎

Generates a random float between 0 (inclusive) and 1 (exclusive).

This does not advance the internal state of the RNG object.


PhantomInt ()⚓︎

int PhantomInt ( int Max )⚓︎

Behaves identically to RandomInt without advancing the internal state of the RNG object.


PhantomNext ()⚓︎

int PhantomNext ( )⚓︎


PhantomPrevious ()⚓︎

int PhantomPrevious ( )⚓︎


PhantomVector ()⚓︎

Vector PhantomVector ( )⚓︎

Returns a random vector with length 1. Multiply this vector by a number for larger random vectors.

This does not advance the internal state of the RNG object.


Previous ()⚓︎

int Previous ( )⚓︎


RandomVector ()⚓︎

Vector RandomVector ( )⚓︎

Returns a random vector with length 1. Multiply this vector by a number for larger random vectors.