Generate random values in OpenBOR script.
Load this library into your module projects to enable controllable random number generation.
Get current upper boundary.
Set a new lower boundary.
Set a new upper boundary.
Load this library into your module projects to enable controllable random number generation.
Dependencies
DC InstanceInstallation
- Install any listed dependencies. See an individual dependency's specific instructions.
- Download and unzip the latest release.
- Place the dc_d20 folder into your data/scripts folder.
- Add
#include data/scripts/dc_d20/main.c
into any other script you would like to add this library’s functionality to. Note any of the "DC" library series listing this as a dependency will already have this step completed. - (Optional) Open config.h to modify default values used in the library.
Use Cases
Generate a random integer between lower and upper boundary. If you do not set upper and lower boundaries, default values will be used.
C:
int i = dc_d20_int();
Configuration
Range
Get current lower boundary for number generation.
C:
int i = dc_d20_get_member_range_min();
Get current upper boundary.
C:
int i = dc_d20_get_member_range_max();
Set a new lower boundary.
C:
int i = {int};
dc_d20_set_member_range_min(i);
Set a new upper boundary.
C:
int i = {int};
dc_d20_set_member_range_max(i);