I was trying to make some random events with a wac script to keep maps interesting even if you played it 5 times already. The random events would put some nasty bgs and grenade launchers in different spots each time. I made a test wac script that would generate a few random numbers between 1 and 11 on the start of the map. However, each time I started the map, it displays the numbers 5, 1, 5, 4, 11, 2 and 2, in the same order. I've been running the script about 5 times now, and it always gives me the same 'random' numbers.
I was hoping the number would be random each time the map starts, which you would expect from a random number, but it seems the game is not really generating random numbers after all. Does anybody knows how this random number is made? If this doesn't work I know some other ways to make the bgs more random (the random bgs are at waypoint Delta and Echo, so there is enough time to put some random scripts that are based on the player, like how many game ticks the team takes to reach Alpha, that would never the same), but the random command would be easier if it would work fine.
The code I tried was simply random(10) and then printing out the value in the rnd variable. And that gave the same pattern each time I restarted the map.
But now I have a better code. I placed a counter that counts from 0 to 3 (when it's 4 it will reset to 0) all the time from the start of the map. When the blue team hits the area trigger near waypoint Charlie, the counter stops. The current value of the counter is then used to do the random events. Since people will never complete the first part of the map in the exact same time, the counter value when you reach Charlie is randomly between 0 and 3. I tried it out and the results are fine, much better then using random() which gives the same value each time.
I remember somebody discussed making the explosions in the Night Shadows map random in VT during one of the map tests. Since it sounds kind of evil doing that, I guess it must be you who came up with that. But I don't know what happened with that idea.
I never used random myself and never saw any complains about it, so I was surprised to see it generated the same numbers each time. However, the works around works perfectly and now it's really random.