Is your feature request related to a problem?
yes! currently if you pull this slick move:
/*fun event*/
randomise();
savedseed = random_get_seed();
irandom(5);
irandom(5);
you will get two random numbers. if you serialize that seed, and then do this when the game launches again:
/*fun event*/
random_set_seed(savedseed);
irandom(5);
irandom(5);
you will get the same two random numbers as when we first generated this seed! it would be nice to be able to save the state of the random number generator so that you can sort of pick up where you left off when it comes to random calls.
Describe the solution you'd like
i would like to see two (2) functions added to gamemaker for this: a random_get_state() and a random_set_state(); the former would return the state of the rng given the current seed and the latter would be able to "catch up" the state of the current seed to whatever random_get_state() returns.
Describe alternatives you've considered
friends i have had to make my own wrapper for every random call to log the type of call, then run through every call at game relaunch to catch the state up.
Additional context
there is no additional context, that's the end folks.
Is your feature request related to a problem?
yes! currently if you pull this slick move:
you will get two random numbers. if you serialize that seed, and then do this when the game launches again:
you will get the same two random numbers as when we first generated this seed! it would be nice to be able to save the state of the random number generator so that you can sort of pick up where you left off when it comes to random calls.
Describe the solution you'd like
i would like to see two (2) functions added to gamemaker for this: a random_get_state() and a random_set_state(); the former would return the state of the rng given the current seed and the latter would be able to "catch up" the state of the current seed to whatever random_get_state() returns.
Describe alternatives you've considered
friends i have had to make my own wrapper for every random call to log the type of call, then run through every call at game relaunch to catch the state up.
Additional context
there is no additional context, that's the end folks.