Skip to main content

Inventory Module

class SoftKitty..InventoryEngine.InventoryModule : EntityModule

InventoryModule is an EntityModule extension that provides inventory functionality to an Entity.

It manages the storage and manipulation of items, allowing an entity to carry, add, remove, and query items during gameplay. The module integrates with the Master Inventory Engine Pro and handles all item-related data associated with the entity.

Because it is implemented as an EntityModule, the inventory system is fully optional and modular. [Entitie]s only contain inventory functionality when this module is present, allowing projects to include or exclude the inventory system without affecting the core entity architecture.

Typical use cases include:

  • Player inventories/equipment

  • NPC inventories/equipment

  • Loot containers

  • Item trading systems

The module also participates in the entity save/load process and runtime initialization, ensuring inventory data persists correctly across game sessions.

To retrieve the InventoryModule from an Entity, use:

mEntity.GetModule<InventoryModule>();

Properties

public List<InventoryData> Inventory

List of the inventories.

public List<string> LootPacks

List of the loot pack uid.


Methods

public InventoryEngine.InventoryData GetAnyInventoryData()

Retrieve any exitsing InventoryData of this Entity when available.


public InventoryEngine.InventoryData GetEquipment()

Retrieve any exitsing Equipment type InventoryData of this Entity when available.


public InventoryEngine.InventoryData GetInventory()

Retrieve any exitsing Inventory|Crate type InventoryData of this Entity when available.


public InventoryEngine.InventoryData GetInventoryDataByType(InventoryEngine.InventoryData.HolderType _type)

Retrieve specified type InventoryData of this Entity when available.


public InventoryEngine.LootPack DropLootPack(int _index = -1)

Drop a Loot Pack this Entity carries, pass an index number for drop a specified pack from the list, otherwise it will random pick one.