Roll20 uses cookies to improve your experience on our site. Cookies enable you to enjoy certain features, social sharing functionality, and tailor message and display ads to your interests on our site and others. They also help us understand how our site is being used. By continuing to use our site, you consent to our use of cookies. Update your cookie preferences .
×
Create a free account

Script to get a non-quantum random number from range.

Is there a way to get the normal pseudorandom number generated without involving the quantum API?
1678887820

Edited 1678887866
GiGs
Pro
Sheet Author
API Scripter
Why wouldn't you want to involve it? Its better in every way. If you're creating a character sheet, just use javascripts random number generator. What is your use case?
It is better in no way except being slower. Normal computer random works just fine for me. Documentation says that Math.Random() was also remapped to the quantum one. Are you saying it's not the case?
1678890370
GiGs
Pro
Sheet Author
API Scripter
Yes, you're correct that Math.random has been remapped - I forgot about that. If normal computer random works just find for you, just use Math.random() - you won't notice any speed difference and the randomiser is better.
I do notice the difference. The "true" randomiser is not better, it just caters to some strange belief of people in "true" random, which I don't subscribe to.
1678891574

Edited 1678891628
GiGs
Pro
Sheet Author
API Scripter
I'm not going to get into a debate of the relative merits of each - we both know how that will go. Though I question how you'd notice the difference, since by your own admission you haven't used non-quantum randomisers on Roll20. That said, if you really want a randomiser that doesnt use QuantumRoll, use randomInteger.
"by your own admission you haven't used non-quantum randomisers on Roll20" ? I used it before quantum was implemented, it was fast and responsive. Quantum is slow and clunky in comparison. It's like playing a FPS with 80 ping versus 300 ping. "randomInteger" Thanks.
1678893642
Kraynic
Pro
Sheet Author
Alex said: Quantum is slow and clunky in comparison. It's like playing a FPS with 80 ping versus 300 ping. I haven't noticed Quantum being slow.  3D dice definitely slow things down, but when I turn those off, then the text results seem to be pretty snappy for any "reasonable" number of dice.  It does take a couple seconds if I am rolling 1k dice for an example of an "unreasonable" number of dice.  Rolling 20 or 50 dice seems be be nearly instantaneous for me though.  Are you playing a game that uses a large number of dice? Just wondering if it is a number of dice thing, or maybe a specific part of the dice roller that works better with one system than the other, like exploding dice or something.
Kraynic said: I haven't noticed Quantum being slow.  3D dice definitely slow things down, but when I turn those off, then the text results seem to be pretty snappy for any "reasonable" number of dice.  It does take a couple seconds if I am rolling 1k dice for an example of an "unreasonable" number of dice.  Rolling 20 or 50 dice seems be be nearly instantaneous for me though.  Are you playing a game that uses a large number of dice? Just wondering if it is a number of dice thing, or maybe a specific part of the dice roller that works better with one system than the other, like exploding dice or something. Regular d20s. Perhaps most people don't notice such things, just like they don't notice added smoothness of 60fps video on youtube, but for myself it is clear when latency is involved. It even says "rolling the dice" in the corner during the delay.
1678904398
GiGs
Pro
Sheet Author
API Scripter
Kraynic said: I haven't noticed Quantum being slow.  3D dice definitely slow things down, but when I turn those off, then the text results seem to be pretty snappy for any "reasonable" number of dice.  I have noticed dice rolling, especially with multiple nested inline dice rolls, to be slow. But that's a very different situation to using random calls in a script or character sheet. Javascript code will process so fast you will never be aware of it - you can queue thousands of commands and they'll happen in the blink of an eye. They are multiple orders of magnitude faster than inline dice rolls (which are asynchronous and have to wait for roll20 server responses).