Equipment Instance

The documentation of Generic Game Framework.

通用库存系统.封面
罗传月武(YueWu)

Author

罗传月武(YueWu)

专注游戏开发和Web技术。

Created: Jul 16, 2025Updated: Sep 15, 2026

Table of contents

What is Equipment Instance

In the Generic Inventory System (GIS), the Equipment System works with slot collection and equipment instance:

  • You can use the inventory system’s slot collection (ItemSlotCollection) to add or remove items with equipment settings.
  • The Equipment System listens for changes in the slot collection to generate or destroy equipment instances.
  • Equipment instances handle the actual logic, such as:
    • When an accessory is equipped, adding passive skills to the character based on the associated item’s skill configuration, and removing them when unequipped.
    • When a weapon is equipped, spawning a weapon Actor from the associated item.
    • When a weapon consumes ammo, updating the ammo count on the associated item instance (since items support saving and loading).
装备系统.装备实例与道具实例关系

Equipment Interface

GIS offers high flexibility: any UObject or Actor implementing the GIS_EquipmentInterface interface can serve as an equipment instance.

Loading Blueprint

Initializing BlueprintUE renderer...

Equipment Instances

Default Equipment Instance

GIS provides a default UObject-based class, GIS_EquipmentInstance, which implements the GIS_EquipmentInterface interface.
It’s recommended to use this instance type and organize your structure as follows:

装备系统.实例结构

For example:Use EquipmentInstance_ARPG to encapsulate logic common to all equipment.

装备系统.实例案例.通用装备

For example: For specific equipment (e.g., weapons), use WeaponInstance_ARPG to handle weapon-specific logic.

装备系统.实例案例.武器

Actor-Based Equipment Instances

In some cases, using an Actor as an equipment instance is more efficient. For example:

  • A SquadActor that spawns a group of NPCs to assist in combat.
  • By implementing GIS_EquipmentInterface, NPCs are spawned in OnEquipmentBeginPlay and destroyed in OnEquipmentEndPlay.

Note for network replication

Actor handle the replication it self, so make sure IsReplicationManagedreturn false while you are implment equipment interface.

Example

Manny and Quinn are set up as equipment instances, switchable between the “pet” equipment group.

装备系统.ActorEquipment配置