Fields
Declaring values on things: ranges, tiers, and the prose the narrator reads.
A field is a value your plugin puts on things: satiety, infection, mana. Declaring one
is usually the first thing a plugin does.
What a declaration gives you
- a range (min and max). Every write is clamped to it.
- tiers: what the narrator says at each band, and what the HUD badge shows.
- visibility: a row on the sheet by default, or a HUD bar.
- optionally, a creation question asked when a player builds their character.
Tiers are what the narrator sees
The narrator never sees the number. It sees the tier prose:
| Band | Narrator reads |
|---|---|
| 0-3 | nothing |
| 4-9 | "he has a fever" |
| 10-14 | "veins darkening at the wrist" |
| 15+ | "barely lucid, burning to the touch" |
Write tiers as something a narrator would say in the scene. "infection: 12" isn't a tier.
Leave the resting tier silent. Otherwise every turn includes a status report.
Bands: absolute or ratio
- No max: bands are absolute values.
- With a max: bands are a fraction of the max.
If your tiers look wrong, check whether you meant to set a max.
Who carries it
| Trait | Lands on |
|---|---|
entity |
everything that moves: players, NPCs, creatures, items |
living |
players, NPCs, creatures |
carryable |
items |
player / npc / creature |
one kind only |
location |
the place itself |
entity does not include locations. A location field is how a place tracks its state:
how corrupted this crypt is, how much game is left in the forest. Read it with
$.location.fields.corruption or $.field('corruption', 'location').
A value per copy
An item field with scope: "instance" lives on one copy, not on the item. A sword rolled
+3 (Blessed) keeps that value, and the next Iron Sword rolls a new one.
The item's name never changes. The player sees what sets a copy apart as a tag next to the name in the pack, the items nearby and the item window, the way charges show:
| Field | Tag shown |
|---|---|
| text or enum | the value as written: +3 (Blessed), Vicious |
| number with tiers | the tier's badge |
| number with no tiers | nothing on the card, and the item window shows the number |
visibility: "never" hides it everywhere. When a player names one copy ("my blessed wand"), the
command reader tells the copies apart by these same values. Write a text value the way you want
it shown, since it is shown as written.
Reading
$.field('infection') // the subject
$.field('infection', 'target') // whoever was aimed at
$.field('corruption', 'location') // the place
$.field('reach', 'weapon') // what the subject wields, null when unarmed
Text and enum fields read like numbers.
Missing reads as null, not 0. See Missing values.
Derived fields
A field with a valueExpr is computed when read, not stored, like a carry limit worked out from
might. You don't write to it. Because nothing is stored, $.hasField() says false for it, so
branch on its inputs instead.