Is there any way that you could make math.random() generate the same random numbers on Android and iOS when given the same seed?
Jump to content
That would work in some projects however my current project needs the random number seed to change on a daily basis, and they should generate the same numbers on Android / iOS.
Looks very promising. Thanks!
I've decided to have a closer look at this native Lua library (MIT license).
math.original_randomseed = math.randomseed math.randomseed = function(x) print("handle randomseed 1 arg form") end math.original_random = math.random math.random = function(m,n) if (not m) then print("handle random 0 arg form") else if (not n) then print("handle random 1 arg form") else print("handle random 2 arg form") end end end
I've always used this code without any problems.
Community Forum Software by IP.Board