forge-attributes owns a character’s stats. An attribute has a base value plus any number of
modifiers from other systems (equipment, effects, buffs). The final value is computed at read
time, so callers always see the live total.
Concepts
- Definition. A stable
attr:<name>with a label, default, min, and max. Ships a generic six-attribute set (STR/DEX/INT/CON/WIS/CHA). - Base value. The character’s own stat, persisted.
- Modifier. A contribution from a source, keyed by
source_idso it can be removed exactly.opisadd(more ops may follow). - Resolution.
final = base + sum(add modifiers), clamped to the definition’s range.
Exports
Modifier shape
Events
Modifiers are cleared automatically when a character deactivates; their owning system re-applies
them on the next activation.
Configuration
The six default attributes live in editableshared/data/attributes.lua
(ForgeAttributes.DefaultAttributes), gated by Config.ShipDefaults. Add or override by id via the
data file or Config.Attributes.
