Introduction
Stats support formulas and functions, allowing you to reference other Stats and perform operations.
Referencing Other Stats#
To reference another Stat, you need only supply the Id of the Stat to use and any selectors.
Stat Value
7 + otherStatIdStat Maximum Value
13 - otherStatId:maxStat Minimum Value
otherStatId:min / 2Stat Special Value
otherStatId:special * 1.5Conditions#
Several options allow you to set a conditional value. You can use the following operators on conditions.
| Operator | Description |
|---|---|
| = | Equal |
| != | Not Equal |
| > | Greater Than |
| >= | Greater Than or Equal |
| < | Less Than |
| <= | Less Than or Equal |
| || | Or |
| && | And |
Functions#
There are several functions built-in to GDTK: Stats, you can also create your own. Below is a list of the functions available by default.
| Function | Description |
|---|---|
| abs | Returns the Absolute value |
| ceil | Returns the Ceiling of a value |
| classLevel | Returns the level of a Class by Id |
| cos | Returns the Cosine of a value |
| floor | Returns the Floor of a value |
| hasAttrib | Returns 1 if a specific Attribute is present |
| hasClass | Returns 1 if a specific Class is present |
| hasPerk | Returns 1 if a specific Perk is present |
| isRace | Returns 1 if the player is a specific Race |
| log | Returns the Logarithm of a value |
| max | Returns the higher of 2 values |
| min | Returns the lower of 2 values |
| rnd | Returns a random float between 2 values |
| rnd_f | Returns a random float between 2 values |
| rnd_i | Returns a random integer between 2 values |
| roll | Simulates rolling X dice each of Y sides |
| sin | Returns the Sine of a value |
| tan | Returns the Tangent of a value |