The BPI_EquipmentPawn blueprint interface we added to our pawn has a function called canEquipThis? which will serve as a validator when trying to equip equipment. You can use this to expand on the criteria required to equip your items.
The ItemRowName, SlotId, and StorageComponent will be provided as an input. From these you should be able to get all the information you need about your item and its dynamic data. You can use the dynamic data to store your additional requirements. For outputs this function has 2 booleans, Handled? And canEquip?. Handled is basically your way to tell the system that you are validating this piece of equipment, and that the result in the canEquip? Return is the validation result.
For example, let's say you have a Fire Staff in your game and you only want a player playing as a Mage to be able to equip it, everyone else should not be able to equip it.
To do this we will use the canEquipThis? function and the Item’s dynamic data. In our Item’s dynamic data (set in the DT_Items) we would add a key to our dynamic data, such as “class”, with a value of “mage”.
Then inside our canEquipThis? Function we will check to see if the item in the slot provided as input (using getItemInSlot on the StorageComponent using the slotID), has our “class” field in the dynamic data. If it does then we know we want to validate it, and if it doesn’t then we will not validate it.
Since we want to validate we use this function to then check to see if the dynamic data’s value matches the class of our player. If it is a match we would return true, and if it is not we return false.
When we opt to not validate it, our item will be equipped. It is only when we respond to the function that we are controlling if it can be equipped.