Page 1 of 2

[Not Implemented] Add random function

Posted: Tue Feb 27, 2018 3:33 am
by peter980
Currently, only CoinFlip check is implemented (50%) chance. It would be good if there is way for more gradual random function.

Re: [Not Implemented] Add random function

Posted: Thu Mar 01, 2018 8:45 pm
by eekdon
Yeah I can put in a ticket for this.

Re: [Not Implemented] Add random function

Posted: Tue Jun 16, 2020 3:30 am
by dev_n
Can you check on the status of that ticket? ;)

It takes a lot of effort to generate a random number with uniform probability through coin flips. Kind frustrating when you consider the outcome of the coinflip function was already determined by calculating a random number.

Re: [Not Implemented] Add random function

Posted: Wed Jun 17, 2020 9:30 am
by eekdon
Yeah I know, it's annoying. I can't promise it'll get done in 0.17.x as we're dealing with a lot at the moment, but I will put it in the to-do list for 0.18.x.

Can you and Peter980 further clarify exactly what would work best? Sounds like a RandomizeIntValue game event, which will take two manually input integers, and product a random value between those two would work fine.

Re: [Not Implemented] Add random function

Posted: Wed Jun 17, 2020 12:13 pm
by peter980
Yes, that would be perfect.
The special case of (0,1) would be current coinflip, while (0,100) would simulate chance in percents.

Re: [Not Implemented] Add random function

Posted: Wed Jun 17, 2020 5:43 pm
by eekdon
Alrighty, thank you!

Re: [Not Implemented] Add random function

Posted: Thu Jun 18, 2020 6:47 pm
by dev_n
Yes (0,100) would be great, thanks!

Re: [Not Implemented] Add random function

Posted: Thu Jun 18, 2020 6:59 pm
by dev_n
If it would be easier, it could be parameterless, just return an int between 0 - 100 that you could compare to with a less than / greater than.

For instance, a criterea might look like {RandomNumber LessThan 30} if you wanted a 30% chance of that event occuring.

Re: [Not Implemented] Add random function

Posted: Thu Jun 18, 2020 10:22 pm
by eekdon
Here is what I am shooting for. Pretty easy, we just got bogged down with other stuff. Should take care of all your needs.

Image

Re: [Not Implemented] Add random function

Posted: Mon Feb 22, 2021 7:37 pm
by PartyBob
Just popping this one back up into visibility. This function would be really useful, as the series of coinflips method is really inefficient for getting randomization.