ID:163925
 
is it possible to make a slimmer than 1/100 chance of a monster dropping an item?

Drops=list(/obj/item/armor/Super_good_armor=1)


If so, please tell =)
I don't believe that the prob() procedure supports decimals, but what you can do is make up your own procedure. Now, I'm not exactly sure how the prob() procedure works, but something like this might do the trick:

proc/myProb(probChance,maxChance=100)
if(rand(1,maxChance)<=probChance) return 1
return 0


That way if you do something like...

if(myProb(90))


It will still work more or less like the original prob() procedure. However, you could also expand it to account for extremely slim chances.

if(myProb(1,1000))
src << "You are the chosen one!" // Or whatever.


If someone else knows a better way to do this, feel free to contribute!
In response to Volte
Volte wrote:
I don't believe that the prob() procedure supports decimals

It does, actually. :P
In response to Foomer
Foomer wrote:
Volte wrote:
I don't believe that the prob() procedure supports decimals

It does, actually. :P

Does it? Last I checked, anything below 1 would be about as consistent as 1. Good to know, then! Thanks.
In response to Volte
You can read all about it here: [link]