I was wondering if there was an efficient way of creating various % chances of certain variables being selected within an array.
Here is an example of what i have so far:
What I am hoping to achieve is to have, lets say integer 3 have a lower % chance of being selected than the other integers within the array.
Is there a good way to go about doing this?
A much better way is to populate the array more with the items you want likely selected and rarely with the ones you want to be rare. Then all you have to do is use a random int on the arrary…
I don’t remember who here on the Answers Portal suggested that some time ago, but one great and effective way of doing such things is using a custom curve. If you need 1%, you can create such curve:
And it will return 3 with 1% chance, and [0-2] with equal chances. What is great in using curves, it’s a really scalable approach. In future, is you want to change the chances, you won’t have to do anything in BP; just change the curve or create several curves and interchange them at will.