Use CharacterInventoryBridge to monitor Nonunique item in MultiStackItemCollection.

WeiYiHua

Member
Hello, I have some problems with UCC integration.
If I use CharacterInventoryBridge to monitor Nonunique item in MultiStackItemCollection. Only one group of items will appear in CharacterInventoryBridge instead of multiple groups of items.

For example, there is many groups of potions that can be stacked. I want the number of one group of potions to be reduced by one after use, and it will not affect the potions of other groups.

My current solution is to create a class that inherits the IItemIdentifier interface, which stores the ItemStack. And customize an InventoryBridge to map ItemStack to this class, and then use this class as the ItemIdentifier of CharacterItem. In this way, the mapping between ItemStack and CharacterItem can be known.

Is this solution feasible? Please let me know if future versions will have this feature or if there is a better solution, thank you!
 
Last edited:
That's a very interesting approach, The common items always share the same ID and we didn't take that into account when making the integration script thinking that only unique items would be used.
For now I'd recommend you keep your changes. I will have to look into this in more detail because it changes alot of things.
 
because it changes alot of things.
This is indeed the case. Many places where the Item class is used in the UCC integration need to be modified, and some changes to the ItemStack in the ItemCollection will not call NotifyAdd() or NotifyItemRemoved(). I am trying to solve these problems.
 
I successfully completed it, and now the ItemStack of the UIS will be mapped to the ItemIdentifier of the CharacterItem through the modified CharacterInventoryBridge.

Most of the APIs of UCC have not changed, only a StackedItem class inherited from the Item class has been added, and there are internal modifications to CharacterInventoryBridge.

The API of the UIS has not changed, but the change of each ItemStack is notified when items are added or removed.
 
Last edited:
Top