Common FAQ

Q: I keep getting the same results for rolls whenever I run my program, how do I fix this?

A: RL-Dice does not set a seed by default. If you call the dice module without using math.randomseed(os.time() ) in your project, then the dice behaviour will have the same sequence of results every time you run a program.



Q: My program crashes whenever I try to use this module!

A: An error message will result if the dice notation is incorrectly formatted. A user also must not forget to put a positive or negative sign in front of the bonus or reroll! Those are the two most encountered problems. See valid_dice_notation.lua for more details.



Q: Whenever I roll dice with a negative bonus it never returns a result below 1, why does this keep happening?

A: The minimum is set to 1 by default. This can be overriden quite easily with dice:setMin which has detailed examples of its usage in minimum.lua. In many user cases a negative roll would be determinal and possibly cause issues with the program, thus the minimum was set to 1 to avoid problems.



Q: What was the purpose of implementing dice caching?

A: Most of the users for this module will be using a finite set of dice. It makes sense to store these into a cache for faster performance. This comes in handy especially in cases like world generation where optimization would be time critical! Based on benchmark testing, caching results in nearly a 800% performance boost when using dice already initialized. If memory becomes a problem then a user can always put dice:resetCache to good use.

generated by LDoc 1.4.3 Last updated 2017-07-06 21:00:14