# Getting Start

After download the plugin, check if the plugin is enabled.

<figure><img src="https://534259950-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FheZskC8SUj57bJuHA3dm%2Fuploads%2FfjWil5NrmVRWaAHtFyPv%2Fimage.png?alt=media&#x26;token=91e0879e-a923-4ec6-9258-fbe5c7dd6548" alt=""><figcaption></figcaption></figure>

## 🧍Configuring Character

After making sure the plugin is activated, you need add ***Inventory*** Component to your character.

<div align="left"><figure><img src="https://534259950-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FheZskC8SUj57bJuHA3dm%2Fuploads%2FADAE2NupkMSQIuJXE0Ve%2Fimage.png?alt=media&#x26;token=e88a312f-d973-49be-9fbb-afd0157ae79e" alt=""><figcaption></figcaption></figure></div>

You can edit ***Inventory*** settings in **Details** tab

<div align="left"><figure><img src="https://534259950-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FheZskC8SUj57bJuHA3dm%2Fuploads%2FL8yB7TNIuHqkOSkGsbfo%2Fimage.png?alt=media&#x26;token=be9a044b-dbc2-42b1-8e26-2de0f379f9c5" alt=""><figcaption></figcaption></figure></div>

> ***Inventory Size*** (Replicated)
>
> Maximum inventory slots (-1 = unlimited).&#x20;
>
> Replicated to clients.

> ***Use Weight*** (Replicated)
>
> Indicates whether the inventory system will use a weight system to limit the player's carrying capacity.

> ***Count All Instances*** (Replicated)
>
> If true, all item instances are counted toward weight (otherwise, stacks count once).

> ***Max Weight Supported*** (Replicated)
>
> Specifies the maximum weight that the player can carry (if ***Use Weight*** = true).&#x20;
>
> The unit of measurement is arbitrary and can be defined by the developer.&#x20;

You will also need to create a widget to access the inventory, in the plugin's Example Content we already have a great widget, you can modify it or create your own by following:[Broken link](https://frytinhass-organization.gitbook.io/universal-inventory-system/broken-reference "mention")

To add it, just call it in the character's Begin Play (or anywhere else you use to create a HUD)

<figure><img src="https://534259950-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FheZskC8SUj57bJuHA3dm%2Fuploads%2F24kkByQqmDjI5POqSSDJ%2Fimage.png?alt=media&#x26;token=e4d84906-93bb-4c99-b2fc-4df110298453" alt=""><figcaption><p>Made in <em><strong>BP_ThirdPersonCharacter</strong></em> of <em><strong>Third Person</strong></em> Unreal Example Content for MultiplayerUse.</p></figcaption></figure>

<figure><img src="https://534259950-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FheZskC8SUj57bJuHA3dm%2Fuploads%2FNP8LbNWO6JaoBKL6NHzo%2Fimage.png?alt=media&#x26;token=e25071e1-2aad-494f-bb90-93d9639f9731" alt=""><figcaption><p>Made in <em><strong>BP_ThirdPersonCharacter</strong></em> of <em><strong>Third Person</strong></em> Unreal Example Content for Singleplayer Use.</p></figcaption></figure>

We will also add an interaction event so that when we press a key it opens the menu.

<div align="left"><figure><img src="https://534259950-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FheZskC8SUj57bJuHA3dm%2Fuploads%2FoxN9FxT31OjzxVLHPOWl%2Fimage.png?alt=media&#x26;token=0ba45547-1200-484e-9ec6-e9e2a8df56c9" alt=""><figcaption></figcaption></figure></div>

***

## 📦Configuring Items

Create a actor and add ***UIES\_InventoryInterface*** to him.\\

<div align="left"><figure><img src="https://534259950-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FheZskC8SUj57bJuHA3dm%2Fuploads%2FwkQXFMJpoIwfX1zRHy7b%2Fimage.png?alt=media&#x26;token=aba10024-31fd-439a-a11b-c34d2c3c0463" alt=""><figcaption></figcaption></figure></div>

***

{% hint style="info" %}
If you want to work with replication, remember to mark the actor for replication!
{% endhint %}

<div align="left"><figure><img src="https://534259950-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FheZskC8SUj57bJuHA3dm%2Fuploads%2FjdLamG3VjJTRquTyBQNs%2Fimage.png?alt=media&#x26;token=1b895faf-b60f-4950-9560-e6fab4b794ac" alt=""><figcaption></figcaption></figure></div>

***

To find Interface Events, go to the left part of your Blueprint and find the ***Interfaces*** tab.

<div align="left"><figure><img src="https://534259950-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FheZskC8SUj57bJuHA3dm%2Fuploads%2FdfX0rAPNSPOCrYHnErH5%2Fimage.png?alt=media&#x26;token=274a30af-243d-410f-90b8-b3e763832de9" alt=""><figcaption></figcaption></figure></div>

> ***Update Item Info***
>
> ![](https://534259950-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FheZskC8SUj57bJuHA3dm%2Fuploads%2FOZtvazDgnAGSecYpbJ3w%2Fimage.png?alt=media\&token=425430e0-4378-4454-985a-a31b76e26cce)
>
> Updates item data from external sources.
>
> ***NewItemInfo:*** New Updated Item Info.

> ***On Add Item***
>
> ![](https://534259950-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FheZskC8SUj57bJuHA3dm%2Fuploads%2FxMXYVuJVJRdnaeLzDCAi%2Fimage.png?alt=media\&token=e582cb3b-c92c-4cb5-89ce-a3ea697a5057)
>
> Triggered when an item is added to the inventory.
>
> ***InvComponent***: The ***Inventory*** Component where the item is added.&#x20;
>
> ***NewQuantity***: The new quantity of the item after addition.

> ***On Start Use Item***
>
> ![](https://534259950-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FheZskC8SUj57bJuHA3dm%2Fuploads%2F4JZl5akNjB39lqZavTa5%2Fimage.png?alt=media\&token=51d9b612-183c-444e-b019-7a0da70ae4f3)
>
> Triggered when an item starts being used.&#x20;
>
> ***InvComponent***: The ***Inventory*** component that contains the item being used.&#x20;
>
> ***Returns***: A boolean indicating if the item usage successfully started (true) or failed (false).

> ***On End Use Item***
>
> ![](https://534259950-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FheZskC8SUj57bJuHA3dm%2Fuploads%2FF626C0PmemcivRpTJbrF%2Fimage.png?alt=media\&token=9a841167-ae98-4950-8c59-64a1be423927)
>
> Triggered when an item stops being used.&#x20;
>
> ***InvComponent***: The ***Inventory*** component that contains the item being stopped.&#x20;
>
> ***Returns***: A boolean indicating if the item usage was successfully stopped (true) or failed (false).

> ***On Remove Item***&#x20;
>
> ![](https://534259950-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FheZskC8SUj57bJuHA3dm%2Fuploads%2Fvbl0HWbHSFSYh28QkoGU%2Fimage.png?alt=media\&token=cdff5066-dbe9-4c38-a4f4-3f3495b23f30)
>
> Triggered when an item is removed from the inventory.&#x20;
>
> ***InvComponent***: The ***Inventory*** component from which the item is removed.&#x20;
>
> ***NewQuantity***: The new quantity of the item after removal.&#x20;
>
> ***bWasDropped***: Indicates whether the item was dropped (true) or simply removed (false).

> ***Get Item Info by Object***
>
> ![](https://534259950-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FheZskC8SUj57bJuHA3dm%2Fuploads%2FbTViyTMY2xigKHxNt4lP%2Fimage.png?alt=media\&token=457d5910-05fe-481d-9c62-d1ad81e38d08)
>
> Retrieves the Item Info structure for the item associated with the calling Object.&#x20;
>
> ***Returns***: The Item Info containing data about the item (e.g., quantity, weight, etc.).

***

Now that you've configured the character and added the interface, let's create the Item Info!

Let's create a new variable of type ***Item Info***

<div align="left"><figure><img src="https://534259950-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FheZskC8SUj57bJuHA3dm%2Fuploads%2Fh12xbzGpXRHogYVvSQm5%2Fimage.png?alt=media&#x26;token=1f09d31d-d626-486e-a740-6379af09c5de" alt=""><figcaption></figcaption></figure></div>

***

{% hint style="success" %}
If you want the plugin to work properly in Multiplayer, remember to mark it as ***Replicated***!
{% endhint %}

<div align="left"><figure><img src="https://534259950-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FheZskC8SUj57bJuHA3dm%2Fuploads%2FrM3AHh0bnOwJM9M5inUx%2Fimage.png?alt=media&#x26;token=04b2050e-c14e-43f1-9e96-c830cb084f01" alt=""><figcaption><p>You can check for <em><strong>RepNotify</strong></em>, but for the plugin to work this is not necessary.</p></figcaption></figure></div>

***

And so we don't forget, let's connect this variable to the ***Get Item Info by Object*** & ***Update Item Info*** Interface function

<div align="left"><figure><img src="https://534259950-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FheZskC8SUj57bJuHA3dm%2Fuploads%2Fj8CRVvA0omzPp170IOlt%2Fimage.png?alt=media&#x26;token=17a9a9c0-fbc7-4a96-ba2b-29da50a2fe23" alt=""><figcaption></figcaption></figure></div>

<div align="left"><figure><img src="https://534259950-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FheZskC8SUj57bJuHA3dm%2Fuploads%2FqqSRBhHulAXL4QE1kfAM%2Fimage.png?alt=media&#x26;token=ade76048-97bd-40ef-b38d-66e0741e9e94" alt=""><figcaption></figcaption></figure></div>

Now going back to the variable, we have some customization options.

<div align="left"><figure><img src="https://534259950-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FheZskC8SUj57bJuHA3dm%2Fuploads%2Fl9bD730cD3llWohW6HFK%2Fimage.png?alt=media&#x26;token=9bde1267-16ee-429a-a3ac-d09e8bfdf263" alt=""><figcaption></figcaption></figure></div>

> ***Item ID***
>
> A way for the system to identify items, you can use this as the item name (not recommended), but if you don't want to, just change the ***DisplayName*** property.
>
> **!WARNING!**\
> Each type of item MUST have a specific ID, the system interprets any item with the same ID using equality.&#x20;
>
> So if a water bottle and a sword have the same ID, for the system they are the same thing.

> ***Display Name***
>
> The display name of the item. This is shown in UI or HUDs.

> ***Tooltip***
>
> Tooltip information for the item, typically displayed when the user hovers over it.

> ***Description***
>
> A more detailed description of the item, often used in inventory or details panels.

> ***Remove Item on Use***
>
> Determines if the item should be removed after it is used (consumables).
>
> Or it must be kept in the inventory (like a sword).

> ***Can be Dropped***
>
> Defines whether an item can be dropped or not.&#x20;
>
> **!WARNING!** \
> If marked as false, the item can only be removed after use.

> ***Quantity***
>
> Current quantity of the item. Minimum is 1.

> ***Max Quantity***
>
> Maximum quantity allowed for the item. Setting this to -1 means infinite quantity is allowed.

> ***Use Weight***
>
> Flag indicating whether the item's weight system should be used (affects inventory calculations).

> ***Use Mesh Mass***
>
> Flag indicating whether the item should use its mesh's physical mass for weight calculations.

> ***Individual Item Weight***
>
> The weight of a single instance of this item. Only used if ***Use Mesh Mass*** is false.

***

Now that you've done the basics for everything to be in harmony, you need to add a function to this item. Let's make a water bottle! \
I made a simple script in the water bottle blueprint to increase the player's water percentage when the item is used.

<figure><img src="https://534259950-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FheZskC8SUj57bJuHA3dm%2Fuploads%2FtAy6bjYCS9s1tGRSmwJ3%2Fimage.png?alt=media&#x26;token=68489e64-9188-4804-8639-57718841c75e" alt=""><figcaption></figcaption></figure>

<div align="left"><figure><img src="https://534259950-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FheZskC8SUj57bJuHA3dm%2Fuploads%2FsDqYLWevKEK3lWcEyIVf%2Fimage.png?alt=media&#x26;token=f3ac64b0-caf2-415a-a497-e7081e0cc29b" alt="" width="345"><figcaption><p>If you are not working with replication, <br>you can use a single event to do all of this, without RPC calls.</p></figcaption></figure></div>

IIn the plugin's example content, a variable (replicated) was created in the character and another in the hud, so we just need to add value to the character's variable, and then apply that value to the hud using a Client RPC call when we use the item.

Ready! Now our item does something when we use it.

***

It is also possible to override the ***On Add Item*** function to define something to do when the item is added to the inventory.

<div align="left"><figure><img src="https://534259950-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FheZskC8SUj57bJuHA3dm%2Fuploads%2Fwfz8m3a1ZGhAS1igjUrm%2Fimage.png?alt=media&#x26;token=2401c6b8-57da-4c86-a7c5-e3b330ff8063" alt=""><figcaption></figcaption></figure></div>

We can, for example, attach the item to the player, disable its collision and remove it from view.

<figure><img src="https://534259950-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FheZskC8SUj57bJuHA3dm%2Fuploads%2FGzXVmcsYyqr370AzuRu2%2Fimage.png?alt=media&#x26;token=26e47c52-6d04-4825-a275-dd3ee7da9ca4" alt=""><figcaption></figcaption></figure>

***

But how do we get this item? Well, that's up to you, but let's make a basic interaction system for this item. (I recommend using an interaction plugin, like [Universal Interaction System](https://app.gitbook.com/o/b00XOUUpLk3sFMc8xTtE/s/EvVA0wYmDo53UvoVgelW/))

<figure><img src="https://534259950-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FheZskC8SUj57bJuHA3dm%2Fuploads%2FIxRs9paily4PBm7sFJ2m%2Fimage.png?alt=media&#x26;token=6007edf6-f684-4dfc-960a-2f107c9a64ef" alt=""><figcaption></figcaption></figure>

We can add a collision to our item, ensuring that when the player bumps into the item it is automatically added to the inventory.

<figure><img src="https://534259950-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FheZskC8SUj57bJuHA3dm%2Fuploads%2FYUBfxzJFjcaeLbKqUnNT%2Fimage.png?alt=media&#x26;token=c8df2eff-7aae-4872-80e1-8561001ab2ed" alt=""><figcaption></figcaption></figure>

***

Simply finished! All we need to do is add the items to the map and press play.

<div align="left"><figure><img src="https://534259950-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FheZskC8SUj57bJuHA3dm%2Fuploads%2F23aUVmgwZOmdf0m5McV5%2Fimage.png?alt=media&#x26;token=db23bf39-a26b-41c3-a5d3-9923fdcdaa8e" alt="" width="375"><figcaption></figcaption></figure></div>

<div align="left"><figure><img src="https://534259950-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FheZskC8SUj57bJuHA3dm%2Fuploads%2FTehOlfZ0NKAbnWgvdWFQ%2Fimage.png?alt=media&#x26;token=7d1e9c8b-eea5-4e0d-9bcd-6d3e35d549df" alt="" width="375"><figcaption></figcaption></figure></div>

<div align="left"><figure><img src="https://534259950-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FheZskC8SUj57bJuHA3dm%2Fuploads%2FHHBJzCUDZ7PDKMDASeGy%2Fimage.png?alt=media&#x26;token=cd107a31-8463-4be8-ab0f-6a7bd9382289" alt="" width="375"><figcaption></figcaption></figure></div>
