Forged Alliance Forever Forums
Thim wrote:I need to setup a random seed prior to when the normal seed is setup (as far as I can tell), so I need to setup something that gives me a way to make my calls to math.random() different every game. os.time() isn't working for me when I am using it in Blueprints.lua. Does anyone know what may be causing a problem, or know of another way to get random numbers without resorting to utilities.lua? (those methods also aren't working for me, and I don't think it's on my end)
Why doesn't GetRandomFloat/Int in utilities.lua work for you? They're used throughout the entire codebase.
Sheeo wrote:Thim wrote:I need to setup a random seed prior to when the normal seed is setup (as far as I can tell), so I need to setup something that gives me a way to make my calls to math.random() different every game. os.time() isn't working for me when I am using it in Blueprints.lua. Does anyone know what may be causing a problem, or know of another way to get random numbers without resorting to utilities.lua? (those methods also aren't working for me, and I don't think it's on my end)
You can't call os.time from within the sim.
Why doesn't GetRandomFloat/Int in utilities.lua work for you? They're used throughout the entire codebase.
ckitching wrote:Sheeo wrote:Thim wrote:I need to setup a random seed prior to when the normal seed is setup (as far as I can tell), so I need to setup something that gives me a way to make my calls to math.random() different every game. os.time() isn't working for me when I am using it in Blueprints.lua. Does anyone know what may be causing a problem, or know of another way to get random numbers without resorting to utilities.lua? (those methods also aren't working for me, and I don't think it's on my end)
You can't call os.time from within the sim.
Why doesn't GetRandomFloat/Int in utilities.lua work for you? They're used throughout the entire codebase.
There's also GetSystemTimeSeconds(), which returns the system time as a fractional number of seconds (amusingly enough). It's probably millisecond-precise, plus floating point error.
Users browsing this forum: No registered users and 1 guest