Command
item
item
The item command manages the runtime inventory.
Syntax
item add <id> "<name>" "<description>" icon "<image_path>" [amount <int>];
item remove <id> [amount <int>];
item clear;
Quick Start
label start:
item add key_101 "Room Key" "Opens room 101." icon "items/key.png";
item add coin "Coin" "A small coin." icon "items/coin.png" amount 3;
item remove coin amount 1;
Behavior
item add: inserts item if missing, otherwise increments existing count.item remove: decrements count; item is removed when count becomes<= 0.item clear: removes all inventory entries.idis the unique key. Keep it stable and lowercase-friendly (room_key,coin,quest_letter).- If
item removereferences an item that is not present, runtime safely ignores it.
Data Model
Each inventory entry stores:
id: unique script idname: UI display namedescription: tooltip/body texticon: sprite-path stringcount: stack amount
Inventory UI
Press I during gameplay to toggle inventory.
- Hover slot: shows name + description tooltip.
Esc: close inventory.- Click outside panel: close inventory.
- If item count exceeds one page:
- Mouse wheel scrolls pages.
PgUp/PgDnchanges pages.- Arrow keys also change pages while inventory is open.
Feature Toggle
Inventory hotkey/toggle can be disabled in project.json:
"features": {
"items": { "use": false, "path": "items.cvn" }
}
When disabled:
Iwill not open inventory.inventory_togglejump target is ignored.itemcommands become no-ops.
Notes
- Inventory is runtime state; it is saved/loaded with save slots.
- Use
item clear;only when you intentionally reset progression.