Skip to content

🎒 Pickups → Inventory Integration

This folder provides an optional integration bridge between the Pickups system and the RevFramework Inventory system.

It allows pickup effects to grant items into an inventory without introducing a hard dependency on the Inventory module.

This integration is built and supported for RevFramework systems only. It is not intended as a general integration layer for third-party inventory solutions.


🧠 What This Integration Does

This integration includes:

  • A soft-linked pickup effect (GiveItemEffect)
  • A runtime integration example scene
  • Supporting scene content for testing and learning

It demonstrates how pickups can:

  • Grant items into an inventory container
  • Specify a target container (e.g. "Backpack")
  • Apply item changes using a soft-linked Inventory service

👉 Pickups remain fully decoupled from Inventory.


🎮 Integration Scene

This folder also includes a demo scene that shows:

  • World pickups granting items into Inventory
  • The same pickup flow working alongside non-Inventory behaviour
  • InventoryQuickstartPanel used to visualise results

👉 This scene exists to demonstrate integration — not to define how Pickups must be used.


🔧 How It Works

Inventory is resolved at runtime using a soft-linked reflection approach.

Resolution

The system attempts to resolve an Inventory service using:

  • InventoryResolve.ServiceFrom(Transform) (via reflection)

If a service is found, the integration:

  1. Constructs an ItemStack via reflection

  2. Assigns:

  3. def → item definition

  4. quantity → amount

  5. Invokes a compatible method on the service

Expected Method Signature

(GameObject owner, ItemStack stack, string containerKey)

The integration calls:

GiveExact(...)

👉 The method must exist on the resolved service for the effect to succeed.


⚠️ Important

This is optional

  • Pickups do not require Inventory
  • This integration only runs if a compatible Inventory service is present

No hard dependency

  • Pickups does not reference the Inventory assembly
  • All interaction is done via reflection
  • You can remove this folder without affecting Pickups

Scene dependency

The demo scene in this folder does depend on Inventory.

If you remove the Inventory module:

  • This scene will no longer function
  • It can be safely deleted, or
  • Cleaned up using the RevFramework Orphan Cleanup tool

Best-effort behaviour

  • If the Inventory service cannot be resolved → no-op (Editor warning)
  • If ItemStack cannot be constructed → no-op
  • If GiveExact is missing → no-op

👉 The effect will fail safely, not throw runtime errors.


Supported setup only

This integration is designed for use with the RevFramework Inventory system.

It relies on:

  • InventoryResolve
  • The standard RevFramework Inventory service
  • The RevFramework ItemStack structure

👉 While this may work with custom inventory implementations that happen to match these expectations, custom setups are not supported.

If you are using a different Inventory system:

  • Treat this as a reference example
  • Implement your own pickup effect
  • Use your own service layer

🧪 Example Usage

  1. Create a GiveItemPickupDefinition

  2. Assign:

  3. itemDefinition → your Inventory item

  4. quantity → amount
  5. containerKey → target container

  6. Assign the definition to a pickup

  7. Ensure an Inventory service is present in the scene

👉 When the pickup is consumed, the item will be granted if a compatible service is found.


🧠 Design Intent

This integration demonstrates:

  • How Pickups can interact with other RevFramework systems without hard coupling
  • How to use soft dependencies via reflection
  • How to keep systems modular and optional
  • How to structure integration scenes vs core system scenes

🌍 Third-Party / Custom System Use

This integration is built for RevFramework Inventory systems only.

If you are using a different inventory system:

  • Treat this as a reference example
  • Implement your own pickup effect or adapter
  • Use the public APIs of your system

👉 Custom or third-party integrations are not supported by this layer.


🧹 Safe to Remove

This folder is completely optional.

Removing it will:

  • Not affect the Pickups runtime system
  • Not break non-Inventory pickups
  • Only remove Inventory-related pickup behaviour and demo scenes

🧠 Summary

This integration answers:

“How can pickups grant items without depending on the Inventory system?”

It provides:

  • A soft-linked item grant effect
  • A working integration example
  • A safe, optional extension point
  • A clear integration pattern

Use it as a reference, extend it, or replace it entirely.