CONTENT CONTRACT · VERSION 1
variable
Package-owned state with a typed declaration and virtual initial value.
Signature
{ id: ContentId, kind: "variable", lifetime: (VariableLifetime)?, owner_scope: OwnerScope, value: VariableDeclaration }Fields
| Name | Type | Meaning |
|---|---|---|
id | ContentId | Package-qualified identity; unique within its declaring namespace. Length: 1…129; Pattern: ^[a-z][a-z0-9_]{0,31}:[a-z][a-z0-9_]{0,95}$ |
kind | "variable" | Discriminant |
lifetime | VariableLifetime | How long a world or player variable lives: through one run of a quest (back to its initial value when the quest starts over) or as story memory. Required for world and player variables; an actor variable lives with its figure and states none. |
owner_scope | OwnerScope | Kind of persistent owner allowed to store this variable. |
value | VariableDeclaration | Typed payload checked against its owning declaration. |
Validated example
{
"id": "core:backpath_known",
"kind": "variable",
"lifetime": "story",
"owner_scope": "world",
"value": {
"initial": 0,
"max": 1,
"min": 0,
"type": "int"
}
}