Skip to content

00 — Inventory Quickstart (Minimal)

Goal:
Experience the core Inventory loop in under a minute — give, peek, remove, clear, and save/load.


Purpose

Provide the smallest working demonstration of RevFramework’s Inventory system using the InventoryQuickstartPanel.
Ideal for learning the result-first API flow and Snapshot persistence without any optional systems (Equipment, Currency, Crafting, etc.).


🎓 What This Scene Teaches

  • Give items into a container via SceneInventoryService.GiveExact(...).
  • Peek the first 12 slots of the bound container (Backpack by default).
  • Select a slot and remove x1 via the service layer (IInventoryService.RemoveFromSlot(...)).
  • Clear All to reset the container cleanly.
  • Save/Load a snapshot via InventorySnapshots (supports placeholder substitution).

⚠️ Authority Note
This scene runs with Inventory authority permissive by default.
Inventory mutations are allowed locally for demonstration purposes.

Authority binders may appear in demo scenes to make the authority boundary explicit, but Inventory does not fail-closed by default.

Why demo scenes sometimes include binders:
https://revandrab.github.io/RevFramework/authority/#demo-scenes--binders-why-youll-sometimes-see-them


🧩 How to Use

  1. Assign any three ItemDefinitions in the panel’s Quick Items row.
  2. Click Give (x1 by default) to seed the Backpack.
  3. In Backpack (first 12 slots), click a slot to select it.
  4. Click Remove x1 to consume one item from that slot.
  5. Click Clear All to empty the Backpack.
  6. In Snapshots, set a name (e.g. quickstart) and use Save / Load to round-trip the state.

💡 Tip: This scene focuses on the minimal loop.
For splitting, sorting, or equipment examples, see the later Inventory demos.


🔧 Scene Setup

Component Purpose
InventoryQuickstartPanel Teachable overlay showing live operations.
SceneInventoryService Central inventory manager. Assign an ItemDatabase.
CharacterInventory Attached to the player/owner; holds the "Backpack" container.
InventoryAuthorityBinder Optional baseline authority binder (default allow; toggle off to simulate NoAuthority).
Property Default Notes
Container "Backpack" Configurable on the panel.
Toggle Key Backquote (```) Shows/hides the panel.

Scene Path:
Assets/RevFramework/Runtime/Systems/Inventory/Samples/Scenes/00_Quickstart_Minimal/


📝 Notes

  • All operations use result-first returns (InvOpResult), enabling clean UI feedback.
  • Snapshot files save to Application.persistentDataPath.
  • Missing items during load use InventorySnapshotOptions with placeholder substitution.
    -Authority gating is supported via IInventoryAuthority. If no binder is present, service-level mutations default to allowed (single-player friendly). Toggle or replace the binder to simulate/implement multiplayer authority.
  • Item quantities auto-clamp to each ItemDefinition.maxStack.
  • Designed for single-player by default — multiplayer binders will also work if added.