Hello.
I would like to point out that the
Random() core function of NWScript is not as random as you would expect. The Lexicon explains it quite well.
Given the same unmodified Area, the same number of Players in the module, and the same number of calls to Random() made *before* a call such as:
float fRand = IntToFloat(Random(10) + 11);
and the above code will return always the same
random amount.
You can not directly change the seed, but you can -at least- do something to force the random sequence being played to look like something different everytime.
It is sufficient to use a numeric value you really have no control over, such as the current time milliseconds. Then use it in some creative way to force an unpredictable number of calls to Random(). For example:
int nMsec = GetTimeMillisecond () & 0x3F;
while (nMsec--) { Random (1); }
The ideal moment to execute the above snippet is when a PC enters the Area. Everytime a PC enters, the random sequence for that Area shall be offsetted to something that nobody can promptly recognize. And the illusion of true randomness is achieved.
-fox
Modifié par the.gray.fox, 26 juin 2012 - 06:00 .