BaseStat
A base stat is used to define stats that are not calculated. These stats simply exist for the purpose of holding a value. Some examples of base stats are (usually) character names, ability scores, item arrays, etc.
Base stats are very commonly used in computed stat formulas to calculate the
value of said stat (see the ComputedStat example).
As with computed stats, base stats can be overridden by the user or by a mechanic.
A base stat with a modifier override (such as with the addToStat effect)
will still use the value of the base stat, and then add the appropriate
modifier to it. If a value override (such as the one created as a result of
the setStat effect) is used instead, that overridden value will take
precedence.
When getting the value of a base stat, the RPG Companion App stat engine
will essentially return the override value if it exists, and the actual stat
value if not, and then add the overridden modifiers. In pseudocode, that
would look something like get(stat) = (override_value(stat) ?? value(stat)) + (override_modifier(stat) ?? 0).
JSON Format
{
"type": "BaseStat",
"id": ...,
"name": ...,
"plural": ...,
"abbreviation": ...,
"type": ...,
"value_type": ...,
"sub_value_type": ...,
"default_value": ...
}
Fields
| Field | Type | Required | Description |
|---|---|---|---|
default_value | dynamic | ✓ | The default value for the stat. Has to conform to the given value_type. Using null is highly discouraged |