Character Sheet Components
Character sheets are built from a tree of components.
Each component has a number of mandatory and optional fields and certain container components can have a list of embedded components.
Every component (with the exception of the top-level CharacterSheet) must have a unique id that is used to reference it from other components.
Values of Properties
The values of component properties must be one of the following types:
- string
- number (double)
- boolean
Dynamic Property Values
Instead of directly specifying the value of a property, a lambda function can also be specified to dynamically calculate the final value.
Every property (with the exception of id) can also be set by a lambda function.
These must have the following signature:
function(sheet) return value end
The parameter is a table containing all other components of the character sheet, indexed by their id.
For example to define a strength ability score modifier derived from the strength value:
AbilityScore {
id = "str",
name = "Strength",
value = 9,
modifier = function(sheet) return math.floor((sheet["str"].value - 10) / 2) end,
}