CONTENT CONTRACT · VERSION 1
set_variable
Replace this owner’s package-owned variable with a value matching its declaration.
Signature
{ kind: "set_variable", value: StateValue, variable: VariableId }Fields
| Name | Type | Meaning |
|---|---|---|
kind | "set_variable" | Discriminant |
value | StateValue | Typed payload checked against its owning declaration. |
variable | VariableId | Variable declaration that determines type, scope and virtual initial state. Length: 1…129; Pattern: ^[a-z][a-z0-9_]{0,31}:[a-z][a-z0-9_]{0,95}$; Reference: variable |
Validated example
{
"kind": "set_variable",
"value": {
"kind": "int",
"value": 1
},
"variable": "core:potions_used"
}