Repository navigation
EN Create Conditions
Français · Type: reference · Audience: author · Context: engine repository, created project · Status: ready · Applies from: 4.3.0
A condition is data: a string for a flag, an object for the rest, nested with not, all and any. Rules (if),
if commands, exits, topics, hints (until), visible, scripts (while, waitUntil), listeners, map news,
objectives and checkpoints' goals all take one. Each condition's exact shape is also in the generated
DSL reference.
| Condition | True when… |
|---|---|
'tied' / '!tied'
|
the flag is true (any value but false, 0, '') / the flag is false or absent. |
{ has: 'rope' } |
the item is in the inventory (a greyed-out used item still counts). |
{ flag: 'tries', eq: 3 } |
the flag holds exactly that value (a number, a string or a boolean). |
{ flag: 'tries', gte: 2 } |
the flag is a number, 2 or more. An absent flag is false. |
{ flag: 'x', lt: 5 } |
the flag is below 5, or is not a number (an absent flag is true). |
{ not: … }, { all: [ … ] }, { any: [ … ] }
|
not, and, or. |
{ visited: 'market' } |
the player has already entered the market. |
{ room: 'market' } |
the player is in the market now. |
{ prop: ['lamp', 'on'] }, { prop: ['house.lamp', 'on'] }
|
the prop is in that state (in the current room, or 'room.prop'). A prop never changed is in its initial state, else its first. |
{ unlocked: 'market' } |
the place is unlocked on the map. |
{ seen: 'topic.ask.basket' } |
that conversation topic has already been heard (see below). |
{ actorIn: ['grandpa', 'house'] } |
the moving character is in that room (moving characters). |
{ player: 'laverne' } |
this character is the one the player controls now (heroes). |
The code is src/engine/core/cond.ts. The Studio's rule explainer shows which part
of a condition fails, and why (rule explainer).
{
"room": {
"id": "market",
"name": "The market",
"decor": "decor/market",
"actors": { "seller": { "char": "seller" } },
"props": { "stall": { "name": "stall", "states": { "closed": "market/stall_closed", "open": "market/stall_open" } } },
"look": { "seller": "The seller.", "stall": "A flower stall." },
"on": [
{ "id": "market.haggle-done", "verb": "talk", "a": "seller", "if": { "flag": "tries", "gte": 3 },
"do": [{ "say": ["seller", "Fine. Two coins. Take them and go."] }, { "set": "deal" }] },
{ "id": "market.haggle", "verb": "talk", "a": "seller",
"if": { "all": [{ "prop": ["stall", "open"] }, { "not": "deal" }, { "any": [{ "has": "coin" }, { "visited": "market" }] }] },
"do": [{ "inc": "tries" }, { "say": ["seller", "Too low!"] }] }
],
"onEnter": [{ "if": { "flag": "tries", "eq": 2 }, "then": ["One more try. I can feel it."], "else": [] }],
"hints": [{ "id": "market.hint", "until": "deal", "lines": ["Haggle. Again."] }]
},
"layout": {
"walk": { "area": [[20, 300], [620, 300], [630, 395], [10, 395]] },
"entries": { "default": [320, 360] },
"props": { "stall": { "x": 200, "y": 340, "h": 120 } },
"actors": { "seller": { "x": 420, "y": 350 } }
},
"items": { "coin": { "name": "coin", "icon": "items/coin" } },
"characters": { "seller": { "name": "Seller", "color": "#ffb36b", "sprites": { "idle": ["seller/idle"] } } }
}
{ seen: key } reads the save's record of what happened once: a heard topic, a fired once listener, a picked
once option. In a schema 3 game the keys are made from the stable ids
(src/engine/core/keys.ts):
| Thing | Key in schema 3 | Key without ids (schema 2) |
|---|---|---|
| A talk topic | topic.<topic id> |
<room>.<actor>.<index> (for example house.grandma.0) |
A once listener |
event.<listener id> |
event.<room or game>.<index> |
A once option of a choice
|
choice.<option id> |
choice.<room>.<text> |
Limit ·
seen-key-v3In a schema 3 game,{ seen: 'house.grandma.0' }(the positional form older pages showed) is never true: a topic with an id is recorded astopic.<id>. The validator does not checkseenkeys, so a wrong one is silently false.
A flag holds a boolean, a number or a string (which to use). 'name' tests its
truth, { flag, eq } an exact value, { flag, gte } and { flag, lt } a number. Prefer a condition that stays true
once true (a flag set once, an item kept) for objectives and goals: the journal never takes a completed objective
back (chapters and objectives).
npm run validate reports a flag a condition reads that nothing sets, and a flag set that nothing reads; npm run lint
reports a condition that can never be true (cond-never-true).
-
Condinsrc/engine/core/types/content.ts;checkandexplainCondincond.ts. - Reactions, commands, the DSL reference.
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