Blockland Forums > Modification Help
getRandom returning different results on mac and pc
Port:
--- Quote from: otto-san on May 19, 2012, 10:05:13 AM ---why does there need to be something built into the game to let us have our own random number generators
we can make them no problem right now, it'd just be a lot easier if torque hexadecimal support wasn't so wonky
--- End quote ---
Because getRandom, getRandomSeed and setRandomSeed are public. All scripts share them. Thus for seeded generations, you can't be sure you're actually getting your own private generations unless you're doing it all at once.
otto-san:
--- Quote from: Port on May 19, 2012, 10:07:03 AM ---Because getRandom, getRandomSeed and setRandomSeed are public. All scripts share them. Thus for seeded generations, you can't be sure you're actually getting your own private generations unless you're doing it all at once.
--- End quote ---
i thought he meant making an entirely new pseudorandom number generator
zmaster:
What do you mean by different results?
btw:
double = getRandom(min,max);
Port:
--- Quote from: zmaster on May 19, 2012, 10:38:24 AM ---What do you mean by different results?
btw:
double = getRandom(min,max);
--- End quote ---
what
Daenth:
--- Quote from: zmaster on May 19, 2012, 10:38:24 AM ---What do you mean by different results?
btw:
double = getRandom(min,max);
--- End quote ---
That's exactly what I pointed out up there:
--- Quote from: Daenth on May 18, 2012, 06:47:46 PM ---Isn't that what it's supposed to do?... There are no arguments for a seed in getRandom.
I'll assume you meant getRandomSeed, which doesn't need any arguments.
--- End quote ---
--- Quote from: Ipquarx on May 18, 2012, 07:10:29 PM ---Daenth, the random number generator uses a seed. That seed can be set with setRandomSeed.
That is the seed that was used.
--- End quote ---