# Basic Inventory

### Basic Inventory System

**S.B.I.** includes a lightweight, map-based inventory system built for quick interaction setup and small-scale item logic. It’s simple enough for fast prototyping, but modular enough to be expanded.

***

#### 🧍 Player Inventory

The player’s inventory is stored as a **Map** inside the `AC_PlayerInteractions` component:

<figure><img src="/files/Gk7Ag1mMYTsIBLYeo9AA" alt=""><figcaption></figcaption></figure>

Each entry tracks the quantity of a specific item the player is carrying.

***

#### 🗄️ Container Inventory

Actors like drawers or crates use the `AC_Stash` component to manage their contents.

Inside any `BP_MasterTarget` actor, you’ll find the **Stash** category with these setup options:

| Variable      | Type                    | Description                                                                                                                                                                                          |
| ------------- | ----------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `HasStash`    | `Boolean`               | If **true**, the actor will automatically create and attach an `AC_Stash` component at runtime. If **false**, no component is added — keeping performance clean and avoiding unnecessary components. |
| `Stash`       | `Map<EN_Item, Integer>` | Predefined contents of the container                                                                                                                                                                 |
| `WeightLimit` | `Float`                 | Max capacity of the stash (in weight units)                                                                                                                                                          |

On `Begin Play`, the stash is initialized using these values.\
This logic is handled through the `StashCheck` function inside the blueprint.

<figure><img src="/files/NAgD6CzhPttztwiuDsFQ" alt=""><figcaption></figcaption></figure>

<figure><img src="/files/zVWLPTPf2hsjc00OOQjC" alt=""><figcaption></figcaption></figure>

***

#### 🧱 Creating New Items

To define new items:

1. Add a new entry to the `EN_Item` enum.
2. Add a corresponding row to the `DT_ItemList` data table.

By default, each item includes:

* `Name` (display name)
* `Weight` (used for inventory weight checks)

<figure><img src="/files/JVTlIDVI3QWUQpahCdxO" alt=""><figcaption></figcaption></figure>

You can expand the system by adding more columns or attributes as needed.

***

#### ➕ Item Pickup

Loose items (e.g. GasCan, Access Card, Small Battery) are `BP_MasterTarget` actors that automatically trigger the `Add Item` interface when interacted with. If successful, they’ll be added to the player’s inventory and removed from the world.

<figure><img src="/files/ziNcPdCC8c5Fvl33Ofvc" alt=""><figcaption></figcaption></figure>

***

#### 🔁 Item Transfer & Weight Handling

Inventory weight checks are handled globally using functions inside the `BPL_InteractionLibrary`.

These are used when:

* Picking up items from the world
* Transferring items between player and containers

They ensure the receiving inventory has enough free capacity before completing the transfer.

<figure><img src="/files/5m0Ig0lq2WRjZtzUCI1G" alt=""><figcaption></figcaption></figure>

<figure><img src="/files/8xUAJ6M4c2934gJt2Rjx" alt=""><figcaption></figcaption></figure>

***

#### 🧩 Integration with Other Inventory Systems

The built-in system is meant to be a simple default — you’re free to replace or extend it to suit your needs.

To integrate with your own custom inventory system:

* Modify the `BP_MasterControl` or `BP_MasterTarget` blueprints as needed
* You can either **bypass item requirements** entirely or rewire the validation logic to call your own inventory queries

***

> 🛠️ This system is intentionally simple and flexible. It’s a great starting point for prototypes and modular expansion into more advanced inventory mechanics.


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://pororoca-works.gitbook.io/s.b.i-simple-basic-interaction-documentation/basic-inventory.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
