Variable EquipmentSlots is array of structs F_EquipmentSlots where all informations about equipped items are stored.
We can also specify starting items there.
How does it work?
Every ItemType can have multiple slots which in turn can have multiple items (red border means item is Active).
Let’s analyze the image above.
- MeleeWeapon has 1 slot which can store 3 items, it means that only 1 melee weapon can be equipped (cuz of 1 slot) at a time, but this slot can store 3 items (only one of them can be active - equipped)
- Arrows also have 1 slot, but this time it can store only 2 items, so let’s assume that first item will be normal arrows and second explosive arrows,only one of them can be equipped at a time, but they can be swapped in runtime
- Ring has 4 slots and each of them can have 1 item, it means that 4 rings can be equipped at the same time
There are 2 functions which allows to change active item.
- SetSlotActiveIndex where we can set index that will become active
- SwitchSlotActiveIndex where active index is incremented/decremented based on Forward parameter