Page 1 of 1

RandomDiceRoll Bug?

Posted: Sat Feb 17, 2007 8:58 am
by VeNdOr
i've done a test command

Code: Select all

program test(who,param)
    Sendsysmessage(who,CStr(RandomDiceRoll(param)));
endprogram
launching more times with param=2d1000+64800, here is the sequence:

281
935
587
65936
295

there is something strange :D

Posted: Fri Mar 30, 2007 3:08 pm
by Core Essence
Up, this issue is a little bit annoying, already added some pharser to shrink the string, but the problem can still persist with higher numbers I think

Posted: Fri Mar 30, 2007 6:20 pm
by Yukiko
It sounds like it's somehow limiting the random number to 60,000 or less. Similar to the stacked item limit of 60,000.

Posted: Fri Mar 30, 2007 8:10 pm
by MuadDib
No, it seems to be where it's not reading the +- correctly, thus ignoring them. WIll have to look into that.

Posted: Fri Mar 30, 2007 9:28 pm
by MuadDib
If I get time I'll look into this soon, but everything looked as it should :/

Posted: Fri Mar 30, 2007 10:11 pm
by CWO
Even though its already passed as a string, CStr() the param inside the RandomDiceRoll() and see.

Posted: Fri Mar 30, 2007 11:12 pm
by MuadDib
It's due to your large amount on the + side. It pushed the results (I believe) above 66k whatever, and that is the reason on the cutoff of the + amount.

Do the math, it comes out :)

dropping the + to +63000 works just fine every time basically. It's cuz of a limit being hit in the core. Shini would be better to answer the why to this one.

My stab is this though, it's coverting to LONG, and your range is going above that (XXXX hex ability, yours is hitting XXXXX when it breaks).

Posted: Sat Mar 31, 2007 8:54 pm
by CWO
I was thinking that too Muad... its above 16-bit but I thought POL was able to handle those. Plus the one result "65936" throws off that thinking because 0xFFFF = 65535...

Posted: Sat Mar 31, 2007 8:55 pm
by MuadDib
It can, but, the specific internal functions used converts it to a unsigned long that is XXXX, which is where it breaks it.