In my old thread found here I posed a problem that involved using mt_rand().
Well, that problem was solved, but when we executed it, the torch function fired way too often, so I changed the one line of code to read
$torchPercent=$torchlevel*0.2;
This now gives us the outcomes we want with one exception. Anyone who is below level 5 will not get the torch to fire at all. I ran the test on over 1 million tries and came up empty.
I think what is happening is that the $torchPercent is truncating the value rather than rounding it or using it as is. So, my question is two fold. First is, can I force either the mt_rand() or rand() to return either a float or a double and second, do you think that would make that function work better or is there an easier way to deal with this issue?
I have googled all over for trying to get either mt_rand or rand to return floats or doubles but I have found nothing on the subject that is of any use.
As always, your help and suggestions are greatly appreciated.