Scenario triggers (which script?)
| Scenario | Open |
|---|---|
| Slot bag (WoW-style stacks) | inventory_data_resource.gd + item_slot_data.gd + inventory_ui_controller.gd |
| Tetris grid (Diablo/RE footprint) | grid_inventory_logic.gd / inventory_grid.gd |
| Equipment | Item Resources + RPG stats complement; drag via drag_and_drop_slot.gd |
| Loot table | loot_table_resource.gd + item_pickup_node.gd |
| Persist | inventory_persistence.gd (ids + amounts, not nested Resources) |
| Consumables | consumable_item_logic.gd |
| DB lookup | item_database_loader.gd |
MANDATORY reads
- inventory_item_resource.gd β item blueprint
- inventory_data_resource.gd β two-pass stack + weight validation
- inventory_ui_controller.gd β reactive UI that reuses slot controls
NEVER Do in Inventory Systems
- NEVER use Nodes for items β
Item extends Resource. - NEVER add without stack/weight pre-checks β validate capacity first.
- NEVER let UI mutate inventory arrays silently β data owns mutations; UI listens.
- NEVER use
floatfor quantities βintstacks. - NEVER emit per-item signals in a batch β one
inventory_updatedafter the loop. - NEVER hardcode item references β String/StringName ids + database.
- NEVER
queue_free+ recreate all slots every refresh β reuse slot widgets (see UI controller). - NEVER allocate new Resources inside
_process. - NEVER mutate a shared item blueprint at runtime β use
duplicate(true)on stack/slot instances so one pickup cannot corrupt every copy of that.tres. - NEVER access
.iconon a null slot item β guard withis_instance_valid()before drawing UI.
Decision trees
Add item
- Weight/volume OK?
- Pass 1: fill partial stacks
- Pass 2: empty slots / grid footprint
- Return overflow count; single UI signal
UI
- Bind once to
inventory_updated - Update existing slot nodes; create only when slot count grows
Save
- Serialize
item_id/resource_path+amountonly β inventory_persistence.gd
Deep recipes (on demand)
| Topic | Reference / script |
|---|---|
| Resource item model | core-architecture.md + inventory_item_resource.gd |
| Two-pass stack add | inventory-manager.md + inventory_data_resource.gd |
| Tetris grid footprint | elite-technical-patterns.md + grid_inventory_logic.gd |
| Equipment & crafting | equipment-system.md / crafting-integration.md |
| Reactive UI & save ids | ui-integration.md + inventory_persistence.gd |
Reference
Progressive disclosure: open Official Documentation links only when researching a specific API; load Related Skills when routing to a peer domain β do not preload the whole lattice.
Official Documentation
- Resources β Items, slots, and inventories should be
Resourcedata (not Nodes) so stacks stay lightweight and shareable as.tresdatabases. - Resource β Use
duplicate(true)for runtime stack/slot instances so mutating quantity never corrupts the shared item blueprint. - GDScript exports β
@export/@export_grouppower Inspector-authored ids, icons,max_stack, weight, and loot weights on item Resources. - Using signals β Emit
inventory_changed/ slot signals so UI reflects data; never let slot widgets mutate arrays silently. - Scene organization β Keep βsignals up, calls downβ: UI listens; inventory Resources/managers own add/remove/stack logic.
- GUI containers β
GridContainer/ container sizing is the baseline for slot grids before custom Tetris footprints. - Control β Native
_get_drag_data/_can_drop_data/_drop_dataandset_drag_previewimplement inventory drag-swap without a custom input stack. - Custom GUI controls β Pattern for building slot
Controls that draw icons/counts and participate in drag-and-drop. - Saving games β Persist slot ids + amounts (not full recursive Resources) with the rest of player save data.
- ResourceLoader β Resolve item blueprints by
resource_path/ id at load time instead of embedding textures in every save blob. - JSON β Compact inventory dictionaries (
path/id+amount) forFileAccesssave files without bloating nested Resource graphs. - Random number generation β Weighted loot rolls and chest contents need seeded RNG patterns, not ad-hoc
randf()sprinkled in UI code.
Related Skills
Prerequisites
- godot-resource-data-patterns β Inventory is Resource-first (items, slots, loot tables); learn composition/serialization patterns before inventing Node-based item trees.
- godot-signal-architecture β Batch-safe
inventory_updated/ slot signals keep reactive UI in sync without per-item spam or ghost connections. - godot-gdscript-mastery β Typed Resources, Array/Dictionary slot maps, and int stack math assume solid GDScript patterns.
- godot-ui-containers β Slot grids, equipment panels, and responsive inventory windows build on container layout before drag-drop polish.
Complements
- godot-save-load-systems β Inventory persistence must round-trip through the project save schema (ids + counts, migration-safe).
- godot-rpg-stats β Equipment bonuses, encumbrance, and consumable effects need a consistent stats/modifier layer.
- godot-economy-system β Shops, buy/sell, and rarity-weighted loot tables consume the same item Resources and stack rules.
- godot-ability-system β Consumable scrolls, skill books, and gear that grants abilities bridge inventory grants into AbilityManager registration.
- godot-combat-system β Weapons/armor equipped from inventory feed damage and hit pipelines; keep DamageData separate from item metadata.
- godot-ui-theming β Rarity colors, slot styles, and drag previews should live in Theme resources, not hardcoded slot scripts.
Downstream / consumers
- godot-monte-carlo-balancer β After stack sizes, weights, drop rates, and shop prices are data-driven, Monte Carlo sims prove economy/loot bands before shipping curves.
- godot-genre-action-rpg β Action-RPG bags, equipment screens, and loot loops assemble this skill with combat, stats, and quests.
- godot-genre-survival β Weight limits, consumables, and scarce loot are core survival inventory constraints.
- godot-quest-system β Fetch/collect quests query
has_itemand grant rewards through the same inventory add/remove APIs.
Master
- godot-master β Library router and mirrored module entry; use when discovering peer skills or syncing shared script mirrors after Domain Skill edits.