Author Topic: Fixed Random-Of SEXP. Important info for anyone using it.  (Read 1763 times)

0 Members and 1 Guest are viewing this topic.

Offline karajorma

  • King Louie - Jungle VIP
  • Administrator
  • 214
    • Karajorma's Freespace FAQ
Fixed Random-Of SEXP. Important info for anyone using it.
I had a look at the random--of SEXP cause it had a bug in it that I detailed here. 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.
Karajorma's Freespace FAQ. It's almost like asking me yourself.

[ Diaspora ] - [ Seeds Of Rebellion ] - [ Mind Games ]

 

Offline Goober5000

  • HLP Loremaster
  • Moderator
  • 214
    • Goober5000 Productions
Re: Fixed Random-Of SEXP. Important info for anyone using it.
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. :)

  

Offline karajorma

  • King Louie - Jungle VIP
  • Administrator
  • 214
    • Karajorma's Freespace FAQ
Re: Fixed Random-Of SEXP. Important info for anyon
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
Karajorma's Freespace FAQ. It's almost like asking me yourself.

[ Diaspora ] - [ Seeds Of Rebellion ] - [ Mind Games ]