Repository navigation
EN Create Dialogues
Français · Type: tutorial + reference · Audience: author · Context: engine repository, created project · Status: ready · Applies from: 4.3.0
How to write a conversation with a character: talk topics that appear and change, choices, the menu's "Bye", and what makes lines read well on a phone. The first part builds one conversation step by step; the second lists the fields.
Grandma, in the kitchen, with four topics: one that advances the plot, a running gag that changes each time, one that appears only once the tank is drained, and a guess the player picks from two answers. Talking to her opens the topic menu; "Bye" closes it.
- A game with a room (your first game), and the character declared in
game.tswith acolor(characters). - The actor placed in the room's layout (geometry).
-
Topics. In the room,
talklists the topics per actor: each has a stableid, the line the hero says (topic) and what follows (do). Talking to the actor opens the menu; picking a topic makes the hero say it, then runsdo, and the menu comes back until the player picks "Bye".
-
A gag that changes. Wrap the answer in
nth(orcycle,random): a different answer each time, the last one repeating (commands: logic).
-
A topic that appears. Give it an
if: it shows only while the condition holds. Grandpa's "There was no key in the tank!" shows only oncetank_drainedis set.
-
A choice. In
do,{ choice: [...] }offers the player lines to pick; the hero says the picked one, then itsdoruns.once: trueon an option shows it once.
-
Check it.
npm run validate(in a created project,npx quest-n-click validate), then talk to her on the dev server.
The whole room, checked by the validator:
{
"room": {
"id": "kitchen",
"name": "The kitchen",
"decor": "decor/kitchen",
"actors": { "grandma": { "char": "grandma", "facing": "left" } },
"look": { "grandma": "Grandma, stirring a pot." },
"talk": {
"grandma": [
{ "id": "ask.key", "topic": "Where is the key?",
"do": [{ "say": ["grandma", "Somewhere safe. Somewhere wet."] }, { "set": "key_hint" }] },
{ "id": "ask.dinner", "topic": "What's for dinner?",
"do": [{ "nth": [
[{ "say": ["grandma", "Soup."] }],
[{ "say": ["grandma", "Still soup."] }],
[{ "say": ["grandma", "Soup. It is always soup."] }]
], "id": "dinner.count" }] },
{ "id": "ask.tank", "topic": "There was no key in the tank!", "if": "tank_drained",
"do": [{ "say": ["grandma", "Then try the pantry, dear."] }] },
{ "id": "ask.guess", "topic": "Guess who stole the key?",
"do": [{ "choice": [
{ "id": "guess.cat", "text": "The cat.", "do": [{ "set": ["guess", "cat"] }, { "say": ["grandma", "Biscuit? Never."] }] },
{ "id": "guess.grandpa", "text": "Grandpa.", "once": true, "do": [{ "set": ["guess", "grandpa"] }, { "say": ["grandma", "Hm. Maybe."] }] }
] }] }
]
},
"hints": [{ "id": "kitchen.hint", "until": "key_hint", "lines": ["Ask Grandma about the key."] }]
},
"layout": {
"walk": { "area": [[20, 300], [620, 300], [630, 395], [10, 395]] },
"entries": { "default": [320, 360] },
"actors": { "grandma": { "x": 420, "y": 350 } }
},
"characters": {
"grandma": { "name": "Grandma", "color": "#ff9ec4", "kind": ["person"], "sprites": { "idle": ["grandma/idle"] },
"hug": "Always.", "refuse": "Keep it, dear." }
}
}
| Field | What |
|---|---|
id |
Stable id, required in schema 3: the save remembers a heard topic under topic.<id>. |
topic |
The line the hero says when it is picked (and the menu's label). |
if |
The topic shows only while this holds. |
do |
What follows. |
A topic already heard stays in the menu, marked as seen. A conversation is one action: it is saved once whole at
"Bye" (since 4.3.0 each finished topic is saved as soon as it ends, when the conversation is the rest of the action).
{ seen: 'topic.ask.key' } tests that a topic was heard (conditions).
globalTalk in game.ts sets what every menu adds: bye (the last entry, "…" when absent), byeLine (what the hero
says on leaving, nothing when absent), hug (an extra entry, only when set). Picking the hug makes the hero say it and
the character answer with their hug line (♥ when absent). Give each character a hug line and a refuse line:
cheap, and players love them.
{ choice: [{ id, text, do, if?, once?, img? }, …] } works anywhere a command does, in a topic or in a cutscene. Only
the options whose if holds are offered; a once option disappears once picked (remembered as choice.<id>); with
no option left, nothing is shown. img (a manifest id, a portrait for instance) shows the option as a card with the
image and its text as the label (the screen reader's name too); cards come first. The solver tries every option.
{ talk: 'grandma' } opens an actor's menu from a rule or a cutscene. A character speaks to the hero without a menu
with { say: [...] }; a call is { phone: 'grandma', do: [...] } (commands). A
character with no topics answers Talk with the talk fallback (reactions).
-
2 to 4 topics per character, one that advances the plot. Grandma: "Where is the key?" (plot), "What is for
dinner?" (a gag with
nth), "Why lock the sardines?" (character). The plot topic goes first. -
Topics can appear and change with
if. -
choicesparingly. Use it when the player's answer is fun to pick, not to branch the story. The demo has two: the opening guess (it setsguess, judged at the end) and Lou's "argue or accept", where both answers lead forward. -
Speech colours come from
coloron each character. Make them distinct: Grandma#ff9ec4, Grandpa#8fd3ff, Lou#b8ff8f, the seller#ffb36b. The demo's hint voice reuses Grandma's colour on purpose. - The transcript keeps every line. Players scroll back: do not hide the only clue in a line said during a cutscene with no other trace.
-
Line length for a phone: under 90 characters, two lines on screen.
validatewarns above 140, but 90 is the comfortable limit. Split long speeches into severalsays.
More on dialogue in the design of a whole game: puzzle design.
- A conversation is a list of topics per actor, each a line and its commands.
-
ifmakes topics appear;nth,cycleandrandommake answers change;choicelets the player pick. - Heard topics and picked options are remembered by their ids.
- See the tree of a conversation: the Studio, or the MCP tool
dialogue_tree(MCP tools). - Translate the lines (translations) and voice them (voices).
- Scripts and events, for what happens without a tap.
Generated publication · publication générée — current documentation · documentation courante: quest'n'click 4.4.0 r1, documentation revision · révision de la documentation 8dc717c69acb62c4742b69c54a7e7dfb620f75d8.
Earlier versions and permalinks · versions précédentes et liens permanents: https://wanoo.github.io/quest-n-click/docs/
An edit made in this wiki is overwritten at the next publication · une modification faite dans ce wiki est écrasée à la publication suivante.
Edit the source · Modifier la source · Report an error · Signaler une erreur
Index (6)
Start (6)
Play (9)
Install (17)
- Requirements
- Install from the release archive
- Install from npm, once published
- Install from the repository to work on the engine
- doctor: checking your machine
- Image toolchain
- Audio toolchain: ffmpeg, fluidsynth, Furnace, uv
- Upgrade
- Upgrade notes: 4.4
- Upgrade notes: 4.3
- Upgrade notes: 4.2
- Upgrade notes: 4.1
- Upgrade notes: v3
- Upgrade notes: v2 to v3
- Coming from web-scumm
- Package reference
- Install troubleshooting
Create a game (55)
- Your first game
- Layout of a created project and of the engine repository
- The working loop
- Content principles and the identity contract
- Rooms
- Geometry: placement, walk zones, masks, layers, camera
- Something is visible but unreachable
- Reactions
- Game commands
- Conditions
- Flags, variables and events: which to use
- Custom code
- Characters
- Items and inventory
- World map
- Dialogues
- Scripts and events
- Moving characters: patrols and walks
- Exits
- Chapters and objectives
- State and saves: persistent or temporary, renaming an id, migrations
- Staging: wide rooms and animations
- The stage: lights, particles, floors
- Skin and fonts
- Title and credits
- Heroes: several characters and hero choice
- Built-in minigames
- A custom minigame
- Translations
- Music in stems
- Sound effects
- Voices: per language and per hero
- Images: prompts, cutting sheets, transparency, scale
- Asset provenance
- The storyboard, source of truth
- Puzzle design
- Classic mechanics
- Review pages
- DSL reference
- Checking your game
- What the solver proves
- Solver options
- Playtests
- Remix
- Speedrun for authors
- The sealed ending
- Production template
- Example games
- Working with an AI
- Build and release a game
- Publish on GitHub Pages
- The static game on Clever Cloud
- Other static hosts
- Sub-path, cache and service worker, incomplete deploys, going back
- Testing on a phone over the LAN
Local Studio (24)
- The local Studio: overview and launch
- Edit a room
- Placement and stage
- Preview, apply, undo
- Storyboard
- Assets and cutting
- Check: validator, solver, critical path, heat, health, coverage
- Before and after captures
- Semantic diff
- Play and replay a session
- Rule explainer
- Language and objectives
- Voices and the heroes × languages matrix
- Map
- Notes
- Remix in the Studio
- Music
- The Assistant: bring your own key
- Demo mode and studio-apply
- Local and LAN security
- Studio API
- Local MCP: setting up each client
- MCP tools
- Studio troubleshooting
Team Studio (21)
- What runs where
- Concepts: revision, transaction, span, lease, preview, build
- Starting as an invited dev
- Working together day to day
- Roles and actions: the full matrix
- Invitations
- Managing members
- Write refused on the hosted Studio: stale base revision (409)
- Write refused on the hosted Studio: span locked (423)
- Recovering after a lost lease, a disconnection or a stale preview
- Comments
- Map and semantic diff
- Publishing builds
- Remote MCP
- The game in Git
- Upgrading the engine of a hosted game
- Hosted assets
- The server's command line
- Health and metrics routes
- Trying it locally with compose.yml
- Known limits
Clever Cloud (23)
- Clever Cloud: overview, cost and prerequisites
- Apps and add-ons
- Domains and TLS
- Keycloak
- Generic OIDC and GitLab
- Configuration
- First deployment
- Backups
- RPO and RTO
- Restore the Studio on a fresh installation
- Redeploys
- Upgrading the server and checking state after a migration
- Limits of going back
- Monitoring
- Security
- Rotating keys
- Recovering admin access
- Changing domain or OIDC provider
- Worker, PostgreSQL or Cellar down
- Exporting the game and leaving the installation
- Retention
- Clever Cloud troubleshooting
- Costs and teardown
Reality Bridge and connectors (16)
- The Reality Bridge: what it is
- Quick start
- Guarantees
- Install and run the Bridge
- Backup and restore
- Several tenants
- Signals and the manifest
- The Bridge's command line
- Connectors overview
- Email connector
- Telnet connector
- SSH connector
- Open Badges connector
- The connector SDK
- Security: Biscuit and signatures
- Bridge and connector troubleshooting
Contribute (25)
- Welcome
- Developer setup
- The dev loop
- Before a pull request
- Conventions
- Writing documentation
- Architecture
- Code tour
- Import boundaries
- Which tests run when
- Mutation testing
- The coverage ratchet
- The quality baseline
- CI explained
- Field passes
- Benchmarks
- Releasing
- npm packages
- Decisions and ADRs
- Governance
- Bot pull requests
- Contributing with AI agents
- Security policy
- Code of conduct
- Licences and credits