I use a slot based inventory. It holds all references to the items I have.
AC_Inventory is an actor component in the player state class.
Any item that’s represented as an attached/rendered asset uses an Actor Obj reference. Items not rendered (ammo, health kits etc) are stored as simple data.
For UI representation I do data table lookups to fetch icons and other information.
Weapon slots are actor obj references of the base weapon class (parent). When a weapon is equipped (in hand) I set current weapon.
e.g. If I equip Primary Weapon 1 I set Current Weapon = Primary Weapon 1
This variable simplifies communication vs a monstrous conditional nest of “is this the right weapon” checks. I use is to call events in the class. Fire, reload, toggle fire mode etc. The weapon class itself has an inventory for its attachments. Muzzle, stock, optic, grip, mag type, cosmetics etc. My game allows me to customize weapons based on attachments found in the world. I can also drop fully equipped weapons. When another player picks it up it has all the attachments, cosmetics that I applied… including the ammo in mag, current firing mode etc.


