Skip to content

Authoring Scenarios

Felipe Lippelt edited this page Jun 5, 2026 · 3 revisions

Authoring: Scenarios · Autoria: Cenários

🇧🇷 Português · 🇬🇧 English

For locked files (front-matter, crack/decrypt, difficulty rolls) see Locked Files. For events/self-destruct/tracer see Cinematics.


English

🛠 Prefer not to hand-edit JSON? The scenario-forge desktop editor builds this whole folder from forms — file tree, lock/crack/tracer flags, dialog, events — validates it and previews it live in this terminal, exporting the versionable folder, a JSON bundle, or a link.

A scenario is a folder: metadata in scenario.json, and the terminal files as real files inside files/. The loader discovers everything on its own — adding a file to the terminal = drop a file in the folder.

src/themes/scenarios/<theme>/<id>/
  scenario.json              ← motd, commands, overrides, login, events
  files/
    document.md              → becomes /document.md  (rendered as markdown)
    logs/report.log          → becomes /logs/report.log  (raw text)
    vault/secret.dat         → locked file (front-matter at the top)

Directories are inferred from the tree. The scenario shows up automatically in scenario list.

scenario.json

{
  "name": "Campaign label",
  "motd": [ "lines shown after the banner" ],
  "commands": {                       // custom commands return static lines
    "my-command": [ "line 1", { "text": "line 2", "type": "err" } ]
  }
}

A scenario can override boot, user, header, prompt, and locks from the theme. Line type: normal · ok · err · muted · user.

Markdown rendering

.md files go through a markdown layer in cat (cinematic); any other extension (.log, .dat, ...) prints raw, like a data dump. Line-level markdown support:

  • # Title / ## Sub → accent highlight, UPPERCASED
  • --- → divider line
  • > quote → indented with
  • - item bullet
  • **bold** → UPPERCASED inline · *italic* / `code` → markers stripped

Login gate (optional)

A scenario can require authentication before the terminal unlocks — a masked dialog appears after boot, and the motd is withheld until access is granted.

"login": {
  "title": "HALDEN CYBERNETICS // AUTHORIZED USERS ONLY",
  "label": "password:",
  "password": "HALDEN",
  "granted": "Welcome back, Dr. Halden.",
  "denied": "ACCESS DENIED."
}

Dialog: conversational query

query <question> (alias ask) lets the player "talk to the system AI". A dialog block maps keywords to responses — the player's words are lowercased and matched (substring) against each response's match terms; first hit wins, else fallback. When no dialog is set, a scenario's static query command (under commands) still runs, so existing gags keep working.

"dialog": {
  "thinking": "PROCESSING QUERY...",       // optional muted lead-in
  "fallback": "INSUFFICIENT DATA.",        // when nothing matches
  "responses": [
    { "match": ["special order", "937"], "type": "err", "lines": ["CREW EXPENDABLE."] },
    { "match": "organism", "lines": ["UNCLASSIFIED. HOSTILE."] }
  ]
}

Images in files

A file's front-matter can carry image: <url-or-dataURI> (optional imageAlt:). cat-ing it renders that picture, CRT-filtered, above the text — Esper photos, maps, mugshots. Use a data URI (e.g. an inline SVG) to stay asset-free. Plain ASCII art needs nothing special — it prints raw.

---
image: data:image/svg+xml,%3Csvg ... %3C/svg%3E
imageAlt: suspect still, frame 47
---
# CAPTION
...text below the image...

Português

🛠 Prefere não editar JSON na mão? O editor desktop scenario-forge monta essa pasta inteira por formulário — árvore de arquivos, flags de lock/crack/tracer, diálogo, eventos —, valida e testa neste terminal ao vivo, exportando a pasta versionável, um bundle JSON ou um link.

Um cenário é uma pasta: metadata num scenario.json e os arquivos do terminal como arquivos reais dentro de files/. O loader descobre tudo sozinho — adicionar um arquivo ao terminal = soltar um arquivo na pasta.

src/themes/scenarios/<tema>/<id>/
  scenario.json              ← motd, commands, overrides, login, events
  files/
    documento.md             → vira /documento.md  (renderizado como markdown)
    logs/relatorio.log       → vira /logs/relatorio.log  (texto cru)
    cofre/segredo.dat        → arquivo trancado (front-matter no topo)

Diretórios são inferidos da árvore. O cenário aparece automaticamente em scenario list.

scenario.json

{
  "name": "Rótulo da campanha",
  "motd": [ "linhas mostradas após o banner" ],
  "commands": {                       // comandos custom retornam linhas estáticas
    "meu-comando": [ "linha 1", { "text": "linha 2", "type": "err" } ]
  }
}

Um cenário pode sobrescrever boot, user, header, prompt e locks do tema. type de linha: normal · ok · err · muted · user.

Renderização markdown

Arquivos .md passam por um renderizador de markdown no cat (cinematográfico); qualquer outra extensão (.log, .dat, ...) imprime cru, como um dump de dados. Suporte de markdown (nível de linha):

  • # Título / ## Sub → destaque em accent, MAIÚSCULO
  • --- → linha divisória
  • > citação → recuo com
  • - item → bullet
  • **negrito** → MAIÚSCULO inline · *itálico* / `código` → marcadores removidos

Login (opcional)

Um cenário pode exigir autenticação antes de liberar o terminal — abre um diálogo mascarado após o boot, e o motd só aparece depois do acesso concedido.

"login": {
  "title": "HALDEN CYBERNETICS // AUTHORIZED USERS ONLY",
  "label": "password:",
  "password": "HALDEN",
  "granted": "Welcome back, Dr. Halden.",
  "denied": "ACCESS DENIED."
}

Dialog: query conversacional

query <pergunta> (alias ask) deixa o jogador "conversar com a IA do sistema". Um bloco dialog mapeia palavras-chave para respostas — as palavras do jogador são minusculadas e comparadas (substring) com os match de cada resposta; o primeiro acerto vence, senão usa fallback. Sem dialog, um comando query estático do cenário (em commands) ainda roda, preservando gags antigos.

"dialog": {
  "thinking": "PROCESSING QUERY...",       // linha muted opcional
  "fallback": "INSUFFICIENT DATA.",        // quando nada casa
  "responses": [
    { "match": ["special order", "937"], "type": "err", "lines": ["CREW EXPENDABLE."] },
    { "match": "organism", "lines": ["UNCLASSIFIED. HOSTILE."] }
  ]
}

Imagens em arquivos

O front-matter de um arquivo pode ter image: <url-ou-dataURI> (e imageAlt: opcional). Ao dar cat, a imagem aparece com filtro CRT acima do texto — fotos Esper, mapas, mugshots. Use data URI (ex.: um SVG inline) pra não depender de asset. Arte ASCII não precisa de nada especial — imprime cru.

---
image: data:image/svg+xml,%3Csvg ... %3C/svg%3E
imageAlt: still do suspeito, frame 47
---
# LEGENDA
...texto abaixo da imagem...