Repository navigation
EN Create Exits
Français · Type: reference · Audience: author · Context: engine repository, created project · Status: ready · Applies from: 4.2.4
How a room leads to another. You can write a way out by hand, as a hotspot plus a rule that runs goto; declaring it
in the room's exits is shorter, and it tells the tools the map of the world. This page is the reference of exits.
The old "Exits, chapters, saves" chapter of the content guide is now three pages:
- the ways out of a room: this page;
- chapters, invariants and objectives: Chapters and objectives;
- save slots, migrations and what a save keeps: State and saves.
In a room file (game/rooms/<room>.ts in a created project, games/<id>/rooms/<room>.ts in the engine repository):
exits: {
window: { name: 'garden window', to: 'garden', entry: 'house', if: { unlocked: 'garden' },
locked: 'Not yet. First, the key.', sfx: 'door_open', verbs: ['use', 'open', 'push'] },
trapdoor: { name: 'trapdoor', to: 'cellar', oneWay: true },
},What the engine makes of it, when it compiles the game (normalizeExits in
src/engine/core/define.ts):
-
A hotspot of the same id, of kind
exit(plus the kinds you add inkind), visible whenvisibleholds. You place it in the layout like any zone, and its look line goes in the room'slook, as for any hotspot. -
Rules appended at the end of the room's
on: "VERB exit →goto" whenifholds (with thesfxfirst, if any), then a second rule that says thelockedline. Their ids areexit.<room>.<exit>.goandexit.<room>.<exit>.locked. - Your own rules come first. A rule you write on the exit is evaluated before the generated ones, so a special reaction (an item used on the door) still wins.
When if does not hold and there is no locked line, the verb's ordinary fallback answers, as for any hotspot with
no matching rule.
From the exits, the goto commands and the map, the validator knows which rooms nothing leads to and which exits
have no way back; the Studio's Check tab, and in the engine repository npm run page:world, draw that map (see
Review pages). What a single tap on an exit does is onTap, below.
exits is a record in a room: the key is the exit's id (also the id of its hotspot), the value an object with the
fields below. The type is ExitDef in src/engine/core/types/content.ts.
| Field | Type | Meaning |
|---|---|---|
name |
string, required | The name shown on hover and in the action line. Translated like every text. |
to |
room id, required | The room the exit leads to. |
entry |
entry id, or [x, y]
|
Where the hero appears: an entry point of the target room's layout (entries), or a point. Without it, see below. |
if |
condition | The exit can be taken only while it holds. |
locked |
string | What the hero says when the exit is tried while if does not hold. |
verbs |
verb ids | The verbs that take the exit. |
sfx |
sound id | Played when leaving (an id of audio.sfx). |
visible |
condition | The hotspot shows only while it holds. |
kind |
string[] | Extra kinds for the hotspot, after exit. |
oneWay |
boolean | The player cannot come back this way, and that is intended: the tools stop reporting a missing way back. |
defaultVerb |
verb id | The verb a double tap uses on it, when the logical one is not right (see Reactions). |
onTap |
'go' or 'walk'
|
What a single tap does with no verb picked: go walks there and goes through on arrival, walk only walks there. |
-
verbs: by default, those ofuse,open,walk,go,enter,push,pullthat your game has. A game with none of these gets every verb of the game exceptlook,talk,giveandtake. -
onTap: by defaultgowhen the game setsinput: { exitOnTap: true }ingame.ts, otherwisewalk. A picked verb still wins; a tap elsewhere during the walk still redirects the hero; a double tap always went through.onTapandexitOnTapare input only: the rules, the solver and saves do not see them. -
entry: without it, the hero comes back where they last stood in the target room; in a room never visited, at its layout'sdefaultentry point (or at 320, 360 when the layout has none).
The validator (npx quest-n-click validate in the created project, GAME=<id> npm run validate in the engine
repository) reports:
- an error for an unknown
toroom (unknown room: "<id>"), anentrythat is not an entry point of the target room's layout, an unknown verb inverbs, an unknownsfx, anonTapother thangoorwalk, and an exit whose id is also a hotspot you wrote ("<id>" is both an exit and a hotspot); - a warning for an exit leading to its own room, for a room no exit,
gotoor map place leads to from the start, and for an exit with no way back (no way back from <to> to <from> (add oneWay: true if intended)).
// game/rooms/house.ts (created project)
exits: { door: { name: 'door', to: 'garden' } },The hotspot door still needs its zone in game/layout/house.json, placed in the Studio's editor; the target room's layout should give a
default entry.
The engine and the validator do not read it. TypeScript reports it, as for any object literal written in a typed
defineRoom.
Declared exits exist since 1.4.0 "Scale". onTap and input.exitOnTap appeared in
4.2.4; defaultVerb in 4.0.0.
Limit ·
exits-input-onlyonTapandinput.exitOnTapchange how a tap reads, not what the game allows: they never open an exit whoseifdoes not hold, and the solver does not see them.
-
goto(the command an exit runs),entries(the layout's entry points): Game commands, Geometry. -
input.exitOnTap,defaultVerb, the double tap: Reactions. - The map of places and
unlocked: World map. - Rooms nothing leads to, seen in the Studio: Check.
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