Max Stack Per Item

epicever

Member
You can learn about ItemRestrictions here: https://opsive.com/support/documentation/ultimate-inventory-system/inventory/item-restrictions/
They are used to restrict the items that get added/removed from an inventory.

From what I understand you wish to limit the size of an item stack but you only want to have one stack per item definition.

We have a multiItemStackCollection that allows you to have multiple stacks of the same Item each with a limit on their size. But that's not what you want.

So what I would recommend is that you create a custom ItemRestriction. You can look how many items you have, how many are being added. You can compare that to the limit you would define as a constant or as an ItemDefinition/Category Attribute. That's what I do internally for the MultiItemStackCollection.

For the weigth system you can also use a custom ItemRestriction with a similar approach.
One you have your ustom IItemRestirctions you can use an "Item Restriction Set Object" to add them to your Inventory.

Feel free to share your solutions once you have them working, and don't hesistate to ask for more help of you are struggling to implement those features. I feel like the item stack size limit one could be something I could make built-in once I have some more free time
 
Top