Does the inventory system support dynamic slots?

Hello, I am making a game, where I have semi-functioning inventory, that changes, dpeending on what armor the player has. Is this feature supported in this asset and if not, how hard would it be to add in?
Thank you

1 Like

Describe what you mean, exactly. The clearer you can state what you’re after, the more likely I can help you through a solution.

I am after inventory, that can change / add / remove equipment slots, depending on what armor the character is wearing. For example having two slots for equipping weapons, when switching to light armor, opposed to having only one when wearing heavy armor. Basically, every armor would have its own predefined equipment slots.

That can be done, through a combination of UI and the Equipment module. I will take a bit of work, and some considerations about how you define each armor set. Currently, it’s set up so that you can do any combination of armor… You could be wearing a leather vest, and plate leggings, for example…

I would define one particular armor slot as a “key” slot. The most logical slot for this is the chest piece. You’ll also need a category for each type of weapon… Perhaps

public enum ArmorStyle
{
     Cloth,
     Leather,
     Chain,
     Plate
}

So we want whatever is in the Chest slot to dictate whether we can equip other items.

The check to see if we can drag an item is in the EquipmentSlotUI script… You’ll need to change MaxAcceptable to reject items that don’t conform to the ArmorStyle in the chest. (It might be best to pass that check along to the Equipment.cs itself).

You’ll need a check in Equipment each time the Chest slot is equipped… if the other items don’t conform to the ArmorStyle, they’ll need to be removed and put back in Inventory.

In EquipmentUpdated, there are a few tricks you can do… One would be to have a separate Equipment Dialogue for each armor style, with the elements you want in each dialogue. Then a script on each of the dialogues activate or deactivate the panel depending on the ArmorStyle.

That’s just a rough outline of the approach I would take for this.

1 Like

This topic was automatically closed after 34 hours. New replies are no longer allowed.

Privacy & Terms