This question should apply to many game programs :
When there is a random number, how does one seed that number after it is generated? i used the GameLogic.getRandomFloat() because the actuator is predictable, but now when 2 numbers are generated at once they are the same, I want an ID number, 0-7, to offset the random number.
Any Ideas? Can I just “seed” the getrandomfloat() function somehow?
Well here’s one way which is slightly better -
x=randomnumber(min,max) [a user function]
x+=ID
if x>max:
x-=max
Hope someone finds that informative, I’m off to read some python docs, maybe there is a available function.
Thanks for the reply xz3ero but you don’t need to go out of your way to track down info for it. (Hope you find the time to work on your own programs/games with all the questions you answer)
I haven’t fooled with randoms in GameBlender but I suppose that I just assume that GameBlender would take care of seeding the random-number generator at the start of each game, so that you do not need to re-seed it yourself unless for some reason you need a repeatable sequence of values. (And then, storing the values in an array is usually simpler.)