random seed
Posted: Sun Apr 19, 2015 3:45 am
I was trying to use a random number in a dungeon editor script. I found the 'math.random' function in a lua document on line. The same document gave a lua function to cause the lua random generator to always generate a different series of numbers. It was 'math.randomseed(os.time()). The problem is the dungeon editor doesn't seem to recognize 'os.time'. Is there any way to access system time in a dungeon editor script? Or is there any other way to seed the random generator with a script?
Follow up:
Before submitting this I tried the random function in the dungeon editor and it seems it does generate a different series of random numbers each time. Can anyone explain why you don't have to seed the generator? Also I would still like to know about accessing the system time.
Follow up:
Before submitting this I tried the random function in the dungeon editor and it seems it does generate a different series of random numbers each time. Can anyone explain why you don't have to seed the generator? Also I would still like to know about accessing the system time.