Developer guide
Code frameworks
A code framework is a game system written as files. You describe the data, write the rules in a small and safe subset of TypeScript, draw the sheet and add scenarios that test it. Fabled compiles the project, runs your scenarios and builds Frameworks, Frames and content from it.
01OverviewLearn what a code project is, how its files map to Frameworks, Elements, Frames and the ledger, and what stays in The Forge.02How Fabled runs your codeFollow a project from source to play: what runs when, how the ledger works, and what a scenario proves.03QuickstartWrite a small game with one character, two actions and a sheet. Then check it and create a character in The Forge.04Grow LanternAdd a choice, a derived value, a child Framework and a list to the quickstart game, and prove each step with a scenario.05Project layout and manifestWhere each file goes, how files are named, and what the manifest must declare.06Framework schemasDeclare inputs, actions, derived values, Frames, content and child Frameworks for one kind of Element.07Writing rulesWrite constructors, actions and ledger functions in a small, safe subset of TypeScript.08Layouts and sheetsDraw a sheet with a Frame, bind it to your fields and wire its buttons to actions.09Testing with scenariosBuild an Element, run actions and check every value and write.10ListsLet a character gain content in play: declare a list, change it with actions, and show it on the sheet.11Rulebook tablesKeep fixed rules data in a table and read it from your rules or use it as the choices of an input.12Pools and modifiersShare a point budget between inputs, and let content change numbers on the character.13Limits and errorsThe limits of a project, and the messages you may see with their fixes.14Clamp a valueKeep a value inside a range with math.max and math.min.15A choice with labelsShow friendly names for a choice while the rules keep the short value.16A derived statCalculate a value from other values with a ledger function.17Roll against a skillCheck a percentile roll against a skill value and report a success band.18Spend a resourceWrite an action that does nothing when a resource is gone, and test both cases.19A starting presetOffer a ready-made Element with values filled in.20A helper functionShare a small calculation inside one rule file.21Bound a numberLimit what a player can enter for a number.22TroubleshootingFind what to do when Save, Check or Prepare fails, or when the sheet shows nothing.

