randgen#

Constructors#

Functions#

int

Rand()

int

Rand(int bound)

int

Rand(int bound1, int bound2)

long

LRand()

long

LRand(long bound)

long

LRand(long bound1, long bound2)

void

SRand(long seed)

long

SRand()

void

Free() deprecated

void

Own()

Constructor descriptions#

randgen randgen() ๐Ÿ”— Source


Function descriptions#

int Rand() ๐Ÿ”— Source

Returns a random number -214748 to 214748, inclusive.


int Rand(int bound) ๐Ÿ”— Source

Returns a random number 0 to bound, inclusive.


int Rand(int bound1, int bound2) ๐Ÿ”— Source

Returns a random number bound1 to bound2, inclusive.


long LRand() ๐Ÿ”— Source

Returns a random long number -2147483648L to 2147483647L, inclusive.


long LRand(long bound) ๐Ÿ”— Source

Returns a random long number 0L to bound, inclusive.


long LRand(long bound1, long bound2) ๐Ÿ”— Source

Returns a random long number bound1 to bound2, inclusive.


void SRand(long seed) ๐Ÿ”— Source

Seeds the RNG with the given seed.


long SRand() ๐Ÿ”— Source

Seeds the RNG with a randomly-determined seed, based off of the system clock and the previous RNG.


void Free() ๐Ÿ”— Source

De-allocates this randgen pointer, so that itsโ€™ pointer ID may be re-used. You may only have a limited number of randgen pointers active at a time; freeing them when you are done with them helps not reach the limit.

Warning

Deprecated! Free() no longer does anything as of ZC 3.0. Objects are now freed automatically.


void Own() ๐Ÿ”— Source

Grants โ€˜Ownershipโ€™ of the randgen pointer to the script that calls this function. When the script with โ€˜Ownershipโ€™ terminates (at the same time itsโ€™ local arrays are deallocated), this randgen pointer will automatically be โ€˜Free()โ€™d.