Hard Light Productions Forums
Modding, Mission Design, and Coding => FS2 Open Coding - The Source Code Project (SCP) => Topic started by: karajorma on March 01, 2006, 02:47:34 pm
-
I had a look at the random--of SEXP cause it had a bug in it that I detailed here (http://lore.maxgaming.net/~scp/mantis/bug_view_page.php?bug_id=0000484). That bug is easily fixed and random-of can be made to function exactly as it was designed to.
There's one major problem with that. The SEXP's proper behaviour is very different from what anyone who has been using it will be expecting.
I suppose it's best to explain.
Design
The FREDder provides a list of arguments. The SEXP picks one of those arguments at random. If the event repeats the SEXP will return the exact same argument it returned the first time. This is true even when using every-time-argument.
Obsevered effects
Anyone who has used random-of will have noticed that it returns a new random result each time it is used and picks the last argument in the list seldom if at all.
Anyway I've fixed the sexp back to the way it was designed to work which unfortunately means that anyone using it now has broken missions. However I've not left you stuck up **** creek without a paddle. I've added a new SEXP random-multiple-of which works the way you would have expected random-of to work (i.e picks the last argument as often as the others).
Just open up your missions in notepad and do a search and replace of random-of with random-multiple and you'll be fine.
-
Also FYI: The other issue, the one that causes it to prefer arguments earlier in the list, is a separate issue and is due to bug in my random algorithm. I'll have that fixed tonight. :)
-
I guess that proves that you haven't done a successful test of a random SEXP until you've got data in the hundreds of iterations rather than just 10-15 datapoints :D