Formulas
RPG Architect leverages a formula engine, allowing users to create their own formulas when leveraging Statistics in Skills and more.
- Whenever a Success Formula is defined anywhere, it is always calculating it out of 100. Specifying a raw value of "100" will ensure that it is always successful.
- Anytime a Success Formula is evaluated, the engine is randomly generating a whole number between 0 and 99. If it is below the value calculated for the Success Formula it will be "successful."
Constants
Name | Reference |
---|---|
e | e |
pi | pi |
Functions
Name | Description | Example | Example Result |
---|---|---|---|
abs | Absolute value | abs(-5) | 5 |
acos | Arccosine | acos(pi) | |
acot | Arccotangent | acot(pi) | |
asin | Arcsine | asin(pi) | |
atan | Arctangent | atan(pi) | |
avg | Average | avg(1,7,12,15,8) | 8.6 |
ceiling | Ceiling | ceiling(1.2) | 2 |
cos | Cosine | cos(pi) | -1 |
dice | Rolls x amount of dice with n sides. dice(x,n) | dice(4,6) | Rolls 4 6-sided dice (Result between 4 and 24) |
dicepool | Rolls x amount of dice with n sides, targeting a minimum value of t per roll. dicepool(x,n,t) | dicepool(4,10,7) | Rolls 4 10-sided dice, attempting to roll 7 or higher. |
floor | Floor | floor(1.2) | 1 |
globalfloat | Gets a global variable as a floating-point. | globalfloat(0) | Gets the global variable at index 0, as a floating point. |
globalint | Gets a global variable as an integer. | globalint(4) | Gets the global variable at index 4, as an integer. |
if | Provides a value if a condition is true or false. if(condition, true_value, false_value) | if(lvl > 10, 15, 20) | Gets 15 if the 'lvl' variable is greater than 10, otherwise 20. |
lastfloat | The last number generated by the formula parser, represented as a floating-point. | lastfloat() | |
lastint | The last number generated by the formula parser represented as an integer. | lastint() | |
loge | Natural Logarithm | loge(2) | |
log10 | Logarithm | log(10) | 1 |
logn | Logarithm (Base) | logn(5, 4) | |
max | Gets the maximum value in a series of numbers. | max(4,8,12,-1,400,2) | 400 |
median | Gets the median value in a series of numbers. | med(4,8,6) | 6 |
min | Gets the minimum value in a series of numbers. | min(4,8,12,-1,400,2) | -1 |
random | Generates a random number between 0.0 and 1.0. | random() | 0.12455. |
sin | Sine | sin(pi) | 0 |
sqrt | https://www.wikipedia.org/wiki/Square root | sqrt(4) | 2 |
- Note: RPG Architect utilizes sonic for its calculation engine, due to its speed and flexibility. You can refer to its wiki for answers to common questions.