Skip to main content

Code frameworks

Recipe: a starting preset

Offer a ready-made Element with values filled in.

Goal

Offer Mira the Warden as a ready-made Keeper with 12 maximum HP.

The change

schemas/keeper.json
  "content": [
    {
      "id": "mira-warden",
      "name": "Mira the Warden",
      "parameters": { "name": "Mira", "max_hp": 12 }
    }
  ]
  1. Lines 19-20 A preset has an id and a name.
  2. Line 21 The input values the preset fills in. They must fit the input bounds.

Preset ids must be unique across the game.

A preset is a fixed starting character. For a bonus that depends on a choice, such as +30 to a skill for one occupation, use a conditional in the constructor, or read a rulebook table there with table.find. The Rulebook tables page shows how. These are the supported ways today. Use a modifier for a bonus that comes and goes, such as a worn item. The Pools and modifiers page shows how.

Test it

Fabled builds each preset when it compiles, so a value that breaks an input's bounds fails the check. There is no scenario to write for a preset. A game can hold up to 512 presets per Framework.

Next