English
Prove a step with a check
You give a step a check: a question the game asks the machine, read only, that answers yes or no. When it says yes, the step turns green on its own; if it stops being true later, the quest reopens (the experience stays won). The player never has to say "I did it".
Before you begin 10 minutes
- A quest pack that passes
alta lint: the quickstart makes one,my-pack.
Prove a file
A
checkstep shows only its check. Thefiletype passes when that path exists under the player's home folder (~/). Write ahintthat says what to do: the step updates by itself when the file appears.A check only reads, and never sends back what it read: here, only whether the folder exists.
my-pack/checks.jsonjson{ "id": "projects", "kind": "check", "title": { "en": "A Projects folder in your home", "fr": "Un dossier Projects chez toi" }, "hint": { "en": "Create ~/Projects: the step turns green on its own.", "fr": "Crée ~/Projects : l'étape passe au vert toute seule." }, "check": { "type": "file", "path": "~/Projects" } }Prove a program
The
bintype passes when a program is installed. For a program the game knows, it also asks the program its version, so a broken install does not pass.my-pack/checks.jsonjson{ "id": "git", "kind": "check", "title": { "en": "Git is installed", "fr": "Git est installé" }, "check": { "type": "bin", "name": "git" } }Prove an answer
A
choicestep saves the player's answer under itssaveskey. Ananswercheck passes once that key has an answer: use it to make a later step, or another quest, wait for the choice.my-pack/checks.jsonjson{ "id": "editor", "kind": "choice", "title": { "en": "Which editor do you use?", "fr": "Quel éditeur utilises-tu ?" }, "choices": [ { "id": "vscode", "label": { "en": "VS Code", "fr": "VS Code" } }, { "id": "zed", "label": { "en": "Zed", "fr": "Zed" } }, { "id": "other", "label": { "en": "Another one", "fr": "Un autre" } } ], "saves": "answers.workbench.editor" }examples/quest-pack/checks.fragment.json#/quests/0/steps/2
my-pack/checks.jsonjson{ "id": "editor-known", "kind": "check", "title": { "en": "Your agent knows your editor", "fr": "Ton agent connaît ton éditeur" }, "check": { "type": "answer", "key": "answers.workbench.editor" } }Prove from the map
The game keeps a map of the player's system: modules, automations, agents, devices. The
worldtype counts entities of a kind (in some states) betweenminandmax;entityasks about one entity;automation,moduleandskillask about one thing by its name.my-pack/checks.jsonjson{ "id": "one-automation", "kind": "check", "title": { "en": "At least one automation runs", "fr": "Au moins une automatisation tourne" }, "check": { "type": "world", "kind": "automation", "state": ["running"], "min": 1 } }Check the pack
Save the complete example as
my-pack/checks.jsonand check the folder. A checktypethe game does not know is refused:check.type. Each type has the fields it needs, listed with every other type on the check types page.my-pack/checks.jsonjson{ "schema": "alta.quests/0.3", "branch": "core", "quests": [ { "id": "workbench", "uid": "core.workbench", "act": 2, "giver": "architect", "title": { "en": "Set up your workbench", "fr": "Installe ton établi" }, "summary": { "en": "A folder for your projects, the tools you code with, and one automation that runs.", "fr": "Un dossier pour tes projets, les outils avec lesquels tu codes, et une automatisation qui tourne." }, "reward": { "xp": 50 }, "steps": [ { "id": "projects", "kind": "check", "title": { "en": "A Projects folder in your home", "fr": "Un dossier Projects chez toi" }, "hint": { "en": "Create ~/Projects: the step turns green on its own.", "fr": "Crée ~/Projects : l'étape passe au vert toute seule." }, "check": { "type": "file", "path": "~/Projects" } }, { "id": "git", "kind": "check", "title": { "en": "Git is installed", "fr": "Git est installé" }, "check": { "type": "bin", "name": "git" } }, { "id": "editor", "kind": "choice", "title": { "en": "Which editor do you use?", "fr": "Quel éditeur utilises-tu ?" }, "choices": [ { "id": "vscode", "label": { "en": "VS Code", "fr": "VS Code" } }, { "id": "zed", "label": { "en": "Zed", "fr": "Zed" } }, { "id": "other", "label": { "en": "Another one", "fr": "Un autre" } } ], "saves": "answers.workbench.editor" }, { "id": "editor-known", "kind": "check", "title": { "en": "Your agent knows your editor", "fr": "Ton agent connaît ton éditeur" }, "check": { "type": "answer", "key": "answers.workbench.editor" } }, { "id": "one-automation", "kind": "check", "title": { "en": "At least one automation runs", "fr": "Au moins une automatisation tourne" }, "check": { "type": "world", "kind": "automation", "state": ["running"], "min": 1 } } ] } ] }examples/quest-pack/checks.fragment.json
Terminalshalta lint my-packOutputtextok my-pack/checks.json (quests) ok my-pack/quests.json (quests) 2 checked, 0 errors, 0 warnings
Try it
alta dev my-packOpen the address it prints, press L for the quests, then open Set up your workbench. In the demo the game reads a pretend machine: some checks pass, others wait. Nothing reads your own files.
Demo: nothing is written on your machine.
Pitfalls
| Do | Avoid |
|---|---|
| A check for what the step changes on the machine | A check that passes before the player did anything |
A hint that says what makes the step pass | A check step with no clue for the player |
Two steps with os when the path differs by system | One path that only exists on macOS |
answer to wait for a choice | answer as the only proof of a daily quest |
A check never returns a value it read, never a secret, and never a file's content. A service check only asks addresses on the player's machine (http://127.0.0.1:<port>). A per-system check table is refused: write one step per system, see One step per system.
Go further
- Check types: every type, its fields, who answers it.
- Quests and proof: why a quest ends on a proof.
- Make a step that does it: a check after an action.