Quote:
Originally Posted by wilian159
I can't see the link, but yes, this 'scheme' is by precise probability, if I use it in integers it won't be so cool,
the item 'Bazooka' has a 0.01% chance, I looped it 2000 times and I don't see it, it's very good
it's very accurate
|
Yes, I know, and that is easy to achieve because it's ratiometric. Just multiply all your values by a factor of 10 to achieve finer resolutions. In your case, to achieve the same probabilities as your original code you would use: 5850, 6170, 1, 10, 250, respectively.
FYI, the way you're doing it now will not result in 58.5% probability of getting "Chinelo" unless all the values in the xProbItems array added up to 100.0. It will result in a 47.6% probability.
Also, I fixed the link. Looks like I had some other code on my clipboard.
__________________