The m_w and m_z variables are the RNG seeds and you must initialise them to a non-zero value before you start using the function. You should be able to use values calculated from one or more player coordinates/angle and/or gameticks passed to seed the RNG at each map (re)start if the decision about who the VIP will be is made some time into the game and the players are allowed to move a bit first.
Exactly. As a reminder, we now have:
1. Implementation of 2 new CVARs; "cv_localtime" and "cv_gmtime".
They're read-only and return the number of seconds since midnight
in local time and GMT time respectively.
This might as well be already sufficient enough. If not, I'd use the angle of one of the players (wait for at least 1 player to spawn, delay a second or two, then read the first player's angle).
Alternative to Random's function (from Worst, helped by rhinoduck + Sr69Mm-jC)
function int Random2 (int min, int max)
m_z = 36969 * (m_z & 65535) + (m_z >> 16);
m_w = 18000 * (m_w & 65535) + (m_w >> 16);
return Abs((m_z << 16) + m_w)%(max-min+1) + min;
The OPEN script will take care of populating the RNG seed (only needed once for one sequence of random numbers) at map start and you can then just use the function. Those two map variables hold the inner state of the RNG, you can assign to them again to change the seed and get a new sequence of random numbers (only needed at each map start in your case - happens in the OPEN script). The Abs function was alright.
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum