Inventory Integration
Ninja Combat introduces streamlined and flexible integration with Ninja Inventory, where all
weapon configuration is now handled by the Inventory System, while the Combat System simply requests weapons from it.
This integration is automatically enabled when both plugins are installed under the same folder structure, {Project}/Plugins/NinjaBearStudio, or both versions are installed from the Unreal store.
Once set up:
Weapon spawning, attachment, features, and configuration are all handled by the Inventory system.
The Combat system no longer directly manages weapons. Instead, it requests the correct weapon actor for each equipment slot.
You can define weapon-specific behavior through item fragments, such as projectile behavior, combo tables, special abilities, or socket attachments.
Weapon Actors
To make your weapon actors compatible with the Inventory + Combat integration, choose one of the following options:
Option 1 (recommended): Use
ANinjaCombatEquipmentWeaponActoras your base weapon class. Consider creating your own base subclass, for project-specific logic.Option 2: If you cannot modify your weapon hierarchy, attach a
UNinjaEquipmentActorComponentto your existing custom weapon actor class.
This allows the actor to represent an equipped item and receive runtime data from the inventory, such as:
The item instance that backs the actor.
Owner and socket data used for proper attachment.
Fragments that define weapon stats, features, level, and other behavior.
Creating Inventory Weapons
If you're creating a new weapon actor, use
ANinjaCombatEquipmentWeaponActoras your base class.If you're using an existing hierarchy, simply add
UNinjaEquipmentActorComponentto your actor.Set your weapon actor as the Actor Class in the Inventory Equipment Fragment for the item.
Weapon Manager
To bridge the Combat System with the Inventory System, use a specialized Weapon Manager that knows how to fetch weapons from equipped inventory items.
Use the component UNinjaCombatEquipmentAdapterComponent, which implements ICombatWeaponManagerInterface and automatically integrates with Ninja Inventory, retrieving weapons from the Inventory Manager.
Using the Equipment Weapon Manager
Add a Ninja Combat Equipment Adapter Component to your character (search for
Equipment Adapter).In your
ICombatSystemInterfaceimplementation, return this component inGetWeaponManager().