The Custom Items and Inventories system uses inventories and sub-inventories to compartmentalize items by sorting, adding, and retrieving items. Refer to Working with Entities and Components for how to add a component to your entity.
Entities are only considered items if they have an item_component. Without one, entities will not be added to inventories properly as well as Custom Item and Inventories functionality may be broken.
References to an “item” are referring to an entity with an
item_component.References to “inventories” are referring to an entity with an
inventory_component.
Class Description
The fort_inventory_component is a subclass of the inventory_component. Its purpose is to provide compatibility between Fortnite gameplay and the new Custom Items and Inventories system. By default players are given an Inventory Root, and then a number of specialized subclasses are added to the Root as sub-inventories.
Whether or not an agent spawns with these Fortnite subinventories is determined by the Custom Inventory Configuration asset that exists in the Island Settings (refer to Inventory Component for more information).
See Components for a complete list of itemization components.
You can access the fort_inventory_component from the component dropdown list. For more information, check out the fort_inventory_component API reference from the Verse API.
Fortnite and the Custom Inventory and Items Feature
Fortnite relies on the fort_inventory subclasses to do specific things:
| Base subclass for all the other Fort Inventories. Also used to hold the Edit Mode tool. Required for Edit Mode. |
| Holds the build recipe items. Required for Edit Mode. |
| Holds equippable Fortnite items like weapons and consumables. Filters items by |
| Filters items by the
|
| Stores the default Fortnite resources, wood, brick and metal. Filters items by the
|
| Stores Fortnite ammo types. Filters items by the
|
| Holds a single item instance. Only allows items with the
|
| Stores any item with the
|
| Holds the Player Harvest Tool. Required for Edit Mode. |
In the diagram above, subinventories are arranged as part of the inventory hierarchy.
Verse: Fort Inventories
These components provide an approximation of the Fortnite: Battle Royale inventory behavior. For example, when items with the ammo item_category are added to the inventory root via AdditemDistribute(), they are placed inside the fort_inventory_ammo_component. Another example is the fort_inventory_weapon_hotbar_component inventory which is limited to five slots, as it is in Fortnite.
You can find the Fortnite item_category definitions in the FortniteItemCategories module in the Fortnite.digest.verse. You can add these categories to your items to make them appear inside the Fort Inventories.
Example
Like other Scene Graph components, the fort_inventory_component and its subclasses can also be added and removed through Verse.
Below is a script for getting specific fort_inventory_components and reading the items inside them. You can write your own systems to leverage Custom Items and Inventories alongside Fortnite Items since they inherit all the functionality of the base inventory_component.
# Copyright Epic Games, Inc. All Rights Reserved.
using { /Fortnite.com/Devices }
using { /Fortnite.com/Itemization }
using { /UnrealEngine.com/Itemization }
using { /Verse.org/Presentation }
using { /Verse.org/SceneGraph }
using { /Verse.org/Simulation }