Repository navigation
EN Create Items
Français · Reference · Published, reviewed by a person · Applies from: 4.3.0
An inventory item is declared once, in game.ts (items, usually from items.ts), and enters the bag with
{ gain }. This page gives an item's fields, how the bag works, how items combine, and what a "used" item is.
Audience, context, and the statuses of what this page rests on
Audience: author · Context: engine repository, created project
items: {
rope: { name: 'rope', icon: 'items/r1c2', look: 'A length of rope. One end for the hook, one for the bucket.' },
},| Field | What |
|---|---|
name |
The display name (the sentence line, {item} in fallback lines). |
icon |
The image in the bag (a manifest id). |
look |
Looking at it in the bag: a line, or a list that gives a different line each time, cycling. |
kind |
Kinds, for the reactions by kind (item in a rules.kinds entry restricts one to that item). |
An item can also be shown in a room as a prop (an image with a name, hidden once taken with
visible: { not: { has: 'talkie' } }): the prop and the item are two things, joined by the rule that takes it
({ hide: 'bucket' }, { gain: 'bucket' }).
- The game starts with
start.inventory(game.ts); a checkpoint names its own (checkpoints.<id>.inventory). -
{ gain: 'rope' }adds an item (once: gaining an item already held changes nothing),{ lose: 'rope' }removes it. -
{ has: 'rope' }tests it (conditions). - Tapping an item with no verb picked selects it for Use; the sentence line says "Use rope with …" and the next tap names the target. With a double tap on a target, an item picked from the bag is given to a character and used on anything else (reactions).
- Several playable characters each have their own bag unless
players.sharedInventory;{ transfer }hands an item over (heroes).
"Use A with B" and "Give A to B" are rules with a the item and b the target. Two inventory items combine both
ways: a rule a: 'left_half', b: 'right_half' also answers "Use right half with left half" (only when both are held).
Rules valid everywhere, combining two items for instance, go in the game's rules.on. With no rule, "Use A with B"
answers with the use2 fallback lines, and "Give" to a character with their refuse line
(reactions).
{ used: 'rope' } (or a list) says the item has served its purpose: it stays in the bag, greyed out, and can no
longer be picked for Use or Give (Look still works). It becomes active again wherever a room or game rule targets it in
a or b and that rule's if condition is true. So keep the rule that consumed it behind an if (here '!tied'),
otherwise it stays active in that room. gain on a used item reactivates it. The used list is saved; older saves load
without it.
{
"room": {
"id": "well",
"name": "The well",
"decor": "decor/well",
"hotspots": { "hook": { "name": "hook" } },
"look": { "hook": "A rusty hook over the well." },
"on": [
{ "id": "well.tie-rope", "verb": "use", "a": "rope", "b": "hook", "if": "!tied",
"do": [{ "set": "tied" }, { "used": "rope" }, "Tied. The rope hangs down the well."] }
],
"hints": [{ "id": "well.hint", "until": "tied", "lines": ["The rope. The hook."] }]
},
"layout": {
"walk": { "area": [[20, 300], [620, 300], [630, 395], [10, 395]] },
"entries": { "default": [320, 360] },
"hotspots": { "hook": { "rect": [300, 120, 40, 40], "approach": [320, 330] } }
},
"items": {
"rope": { "name": "rope", "icon": "items/rope", "look": ["A length of rope.", "Still a rope."], "kind": ["tool"] }
}
}
Limit ·
used-is-not-lostA used item still counts for{ has }. To make it leave the bag,loseit; to test that it was used, set a flag in the rule that used it.
hintItem in game.ts names an item that gives hints when talked to (the demo's walkie-talkie, the template's
note); hintVoice names the character who says them, often an offscreen one. Talking to it gives the current room's
first hint whose until is still false (rooms: hints). The validator refuses a hintItem
that is not an item.
-
ItemDefinsrc/engine/core/types/content.ts;gain,lose,used,transfer(commands);{ has }(conditions). -
npm run lintreports an item never gained (item-never-gained) and a red herring nothing uses (item-red-herring) (checking your game).
Generated publication · publication générée — current documentation · documentation courante: quest'n'click 4.5.3 r1, documentation revision · révision de la documentation b061c4ae6fbeb0be47a11ba8a442ba7e23ecb0a1.
Latest documentation · dernière documentation: https://quest-n-click.cleverapps.io/docs · https://quest-n-click.cleverapps.io/fr/docs; earlier versions · versions précédentes: each release's quest-n-click-docs-<version>.tar.gz · l'archive quest-n-click-docs-<version>.tar.gz de chaque release, https://github.com/Quest-n-Click/quest-n-click/releases
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 (18)
- Requirements
- Install from the release archive
- Install from npm
- 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.5
- 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