Random2 is basically just random() - random(), i.e. it subtracts a random byte value from another random byte value.
It effectively creates a random number between -255 and 255 with the central values more likely.
Well, I've thoughts that random2(9) would returns random(0,9)-random(0,9), i. e. random(0,9) = randompick(0,1,2,3,4,5,6,7,8,9), but wiki says that random(0,9) returns randompick(0,1,8,9):random2(x) is basically random(x)-random(x). The default value for random2() call is 255, so you can get a result between -255 and +255.
So, is have a mistake somewhere or I just understand something wrong about random() calculating and randomization mechanics in general? If it haven't too hard for you, can you explain it on simple examples also, for ex. which result would be in the next examples?:Returns a random integer value between -mask and +mask. It is roughly equivalent to random(0, mask) - random(0, mask). If no mask is provided (random2()), the maximum value of 255 is used instead. Mask is used as a binary mask, e.g. if 9 is used, the random results can be [0, 1, 8, 9] - [0, 1, 8, 9]
random(0,9) =
random(9) =
random2(9) =
------------------------
Btw, what SetRandomSeed[identifier](seedvalue) is and for what it supposed to be used? I've heard a somewhere that it's a something for "saving" randomization result in save file. Anyway I'd wish have see at a some example of usage.