Slots / Specialty Slots

What are Specialty Slots?

Specialty Slots let us define criteria that an item must meet in order to be stored in our storage slot. Specialty Slots are defined in the DT_SpecialtySlots data table in the Blueprints/Variables/DataTables/ folder. The Row Name in this data table is then used to link our specialty slot definition to our storage slot id.

Create a new Specialty Slot Definition

  1. Open the DT_SpecialtySlots data table in the Blueprints/Variables/DataTables/ folder and add a new row.
  2. Give your row a unique and easy to remember Row Name. You will use this row name when referencing this specialty slot.
  3. Fill out the remaining fields to define your specialty slot's criteria. Descriptions for each variable can be found below. Only use the fields that are relevant to your criteria and ignore the rest.
Label Text that appears when you hover over the slot.
Icon The Texture2D that is shown when there is nothing in the slot.
ItemTypes ItemTypes on items are analyzed based on the ItemTypeScope.
ItemSubTypes ItemSubTypes on items are analyzed based on the ItemTypeScope.
ItemTypeScope Used when providing ItemType or ItemSubType criteria, define if the values provided are inclusive or exclusive. Use Only These for an exact match and use Exclude These to allow anything but these.
ItemTagsInclude The item must have these Gameplay Tags (as defined on the DT_Items data table).
ItemTagsExclude The item must not have these Gameplay Tags (as defined by the DT_Items data table).
ItemDataInclude The item data must include these dynamic data keys, and have values greater than or equal to the value. You can optionally prefix your key with ? to make the validation optional and only checked if the key exists, otherwise exclude it from the validation.
EquipmentSlotOverride The equipment slot associated with this specialty slot (if applicable). Used as an override when equipping an item on the pawn.

For example, our demo has multiple trinket specialty slots, and we can equip a trinket in each one. All of our trinkets are linked to the Trinket equipment slot in the equipment data table.

When we are equipping the pawn if our Trinket is in the Trinket 2 specialty slot it will use the Trinket 2 equipment slot on the pawn instead (since our linked equipment slot for the specialty slot is set to override using Trinket 2). This way we can visually show the trinkets in different locations on our pawn depending on what similar slot they are equipped to in our equipment window.

This is where this EquipmentSlotOverride enum comes into play. If you do not set this value (leaving set to null) then no override will occur, and whatever is assigned to the equipment slot in the equipment data table will be used.

Linking a Specialty Slot Definition to a Storage Component Slot

If you are trying to setup specialty slots in the Player’s Inventory, Hotbar, or Bank you would do this through the configuration on the AC_InventorySystem component you added to the Player Controller. Each section of the config will have its own variable to modify the specialty slots in it.

For everything else with an AC_Inventory_Storage component you would modify the specialtySlotsConfig array. Each element in this array will let you define the slot id and the specialty slots definition row name.

Get Specialty Slots from Storage Component

While building your own logic you can use the getSpecialtySlotsOfType function to return an array with the Slot IDs for the specialty slot row name you provide as an input. You can then combo this up with the getItemInSlot function to get the specific item currently in the slot. The crafting workstations system uses this function combo to retrieve the tools and fuel.

Equipment & Workstation Examples

Equipment slots are built on top of specialty slots but are handled a little bit differently.

Equipment slot requirements are built using the Specialty Slots system. For equipment we link a profile to our pawn. This profile is simply a list of the Specialty Slots, defined in another data table. When the equipment system initializes it takes in our profile and outputs our list of specialty slots. This list of specialty slots is then fed into the AC_Inventory_Storage component used for storing the equipment. See more on the Equipment Slots chapter to learn more.

Workstations also use Specialty Slots to define our workstation fuel and tools. The functionality of fuel and how tools are used is controlled inside the workstation component, the specialty slots are used just to define what items can go into the slot.