Overview


Equipment Component allows characters to equip items like weapons / armors / rings etc.
Same as Inventory Component it operates on class Item_Base.

Equipment is made of slots which are made of items.

Every slot type can have multiple slots which can also store multiple items.
In most cases each slot type will only have 1 slot with 1 or more items in that slot.
Many slots are used only in situations where we want to put on more than 1 item of same type at a sime time.

Lets analyse few examples to better understand it


Melee Weapon Slots

This example shows melee weapon slots setup.

  • it has only 1 slot which means that at a time we can have only 1 weapon equipped ( visible ) at a time.
  • this slot can have 3 items in it, it means that we can put there 3 different melee weapons, but still only 1 of them can be equipped at a time.
    item that is currently equipped is defined by ActiveItemIndex and it can be changed in runtime, which will allow owner to switch from Steel Sword to Great Axe
  • ActiveItemIndex is set to 0 ( red background ) which means that currently steel sword is equipped ( visible )
    there is also GreatAxe in Item 1, but it is not active which means that owner doesn't get any bonuses from it and it is not visible in game.

Switching ActiveItemIndex of melee weapon slot in game.

It goes from item 0 ( Steel Sword ) -> item 1 ( Great axe ) -> item 2 ( none )


Ring Slots

This example shows rings slots setup.

  • there are 2 slots which means that at same time owner can equip 2 rings ( both can be visible and give bonuses to owner ).
  • each slot has 1 item as there is no need to switch active ring during game as we do with weapons
  • ActiveItemIndex is set to 0 ( red background ) in both slots which means that both rings are equipped and gives owner bonuses


These functions can be used to get info from equipment or modify it


IsHidden

Each slot also has variable IsHidden which is used in cases when item is equipped but shouldn't give owner bonuses.
For example Shield slot becomes hidden if owner has equipped two-handed weapon.
Then shield stops giving owner block bonuses and instead of being attatched to hand, it gets attatched to back of the character.

These functions are used to modify IsHidden state of slot, but generally you wont need to modify it as EquipmentComponent handles it by itself.