# Multiple_random_states

A downloadable Scripts for Windows

this allows you to have multiple random number generators who's states can be changed separately.. A fantastic use would be for keeping multiplayer games in sync. Just call rand* functions the same number of times on all clients where you need random to stay in sync.

list of functions below:

rand_new_generator([seed]);

returns a random number generator with given seed... if no seed is provided it will be set to random_get_seed()

rand(generator, x);

returns a random number x from the given generator.

randf(generator, x);

returns a random number x from the given generator with 2 decimal places.

rand_choose(generator, *args);

returns a random value from the args using the given generator.

rand_range(generator, x1, x2);

returns a random value between or equal to x1 and x2 using the given generator.

rand_set_seed(generator, seed);

sets the seed for the given generator.

rand_get_start_seed(generator);

returns the seed from which this generator started.

rand_get_current_seed(generator);

returns the current seed for the given generator.

rand_seek_state(generator, n);

increment the seed of given generator n number of times.

rand_get_count(generator);

return the amount of times called since seed was set.

Status | In development |

Category | Assets |

Author | Salvakiya |

Made with | GameMaker: Studio |

Tags | GameMaker, gms, gms14, gms2, scripts |

## Download

Click download now to get access to the following files:

**multiple_random_states.gml**1 kB

**$3.50 USD**or more