|File size||142 B|
|Last updated||3 weeks ago|
|Created||2 months ago|
|Project source||Project URL|
|Report bugs||Bug tracker URL|
This module implements random.org's true random number generator service into the dice rolls of Foundry-VTT. In order to use the module you will need to generate a free api key from https://api.random.org/dashboard
* Install the module using the following manifest url: https://raw.githubusercontent.com/kidfearless/Foundry-TrueRNG/master/module.json
* As GameMaster go to the "Module Settings" tab inside "Configure Settings" and paste in your api key under "Random.org API Key"
* Save Changes. The clients will now all start pulling in random numbers from random.org
`Random.org API Key`[Global] - Required in order to function properly. If you don't provide an api key then Foundry's original random number generator is used.
`Max Cached Dice`[World] - This is the amount of random numbers to pull in at a time for each client. The developer api key is limited on how many numbers it can generate in a day.
So if you have a large number of players or reload the game a lot throughout the session I recommend keeping this `low`.
If you are playing a game that requires rolling large quantities of dice then I recommend setting this `high`.
`Update Point`[World] - Every time a dice is rolled the client checks how many cached values it has left. With the default values it will pull in 50(Max Cached Dice) once it falls below 50%(Update Point).
In that example at 25 cached dice it will generate 50 more random numbers and add them to the existing cache. Again adjust this value based of the number of rolls you do in your game at once.
`Print Debug Modules`[Client] - Prints debug messages into console used during debugging. Can be used to make sure the module is running correctly.
`Enabled`[World] - Enables/Disables the module for everyone in the server.
`Show Quick Toggle Button`[Client/GM] - Toggles the visibility of a button that turns the Enabled setting on and off. Visible only to the gm.
## Implementation Notes
When the module is loaded it replaces the cached random number generator function in `CONFIG.Dice.randomUniform` with it's own `TrueRNG.GetRandomNumber`
as well as caching the original in case of user/server error. It will then generate some server settings and try to grab the current api key.
If the api key exists then it makes a request to random.org immediately, otherwise it will wait for an api key to be set before trying again.
The random numbers are stored in an array and are unique for each client as it turns out that the dice rng function is client sided.
Once the client rolls a dice it will get the current time in milliseconds and modulus it by the length of the current cached values.
I did this because I didn't like the idea of a players role being predetermined at the start of each game.
This at least makes it so that the rolls you get are determined at the start, the order that you get them is random.
If you like this repo and want to support me you can always buy me a pizza 😁
<a href="https://www.buymeacoffee.com/kidfearless" target="_blank"><img src="https://cdn.buymeacoffee.com/buttons/v2/default-violet.png" alt="Buy Me A Coffee" style="height: 60px !important;width: 217px !important;" ></a>
To install this package, open your Foundry Setup screen and navigate to your Module tab and click the Install Module button.
From there, you can either search for the package unique name: truerng or copy its manifest URL:
And paste it to the input box at the bottom of your window.
You can install this package directly to your Forge account.
Necessary cookies are absolutely essential for the website to function properly. This category only includes cookies that ensures basic functionalities and security features of the website. These cookies do not store any personal information.
Functional cookies help to perform certain functionalities like sharing the content of the website on social media platforms, collect feedbacks, and other third-party features.
Analytical cookies are used to understand how visitors interact with the website. These cookies help provide information on metrics the number of visitors, bounce rate, traffic source, etc.
Performance cookies are used to understand and analyze the key performance indexes of the website which helps in delivering a better user experience for the visitors.
Advertisement cookies are used to deliver visitors with customized advertisements based on the pages they visited before and analyze the effectiveness of the ad campaign.