Item Pick up and restriction

bitmore

Member
Hi,
I'm working on an inventory with limited capacity, with ItemCollectionRestrictionObject and ItemTransactionCollection it works well except for these issues:
1: When an InventoryItemPickUp was triggered and the player's inventory is full, the pickup items were rejected, but the InventoryItemPickUp object is disappeared. What I want is, if the player's inventory is full, the player enters the trigger of the InventoryItemPickUp then shows a notification, and the pickup object should NOT disappear.
I can listen to the c_Inventory_OnRejected_ItemInfo event to show the notification, but how can I make the pickup object not disappear?

2: I want the player can unlock more inventory slots by purchasing bag extension, my plan is to rewrite the ItemCollectionStackAmountRestriction, and change the MaxStackAmount depending on how many bag extensions the player has purchased, is there any better solution?

3: I want the inventory grid to only show the unlocked slots, how can I do this?

Best Regards!
 
1) The Interactable component on the item pickup has a boolean for destroying on interact. if you remove that you should be able to keep the pickup from disapearing. But if it never disapears even if you have some space I would recommend create a custom item pickup, it shouldn't be overly complicated but it does require a bit of code.

2) I think that's a good solution

3) Unfortunatly that's not something we have implemented yet. A few users have coded this themselves so i know it is possible, but would require a custom itemViewSlotContainer/InventoryGrid.

I am currently on holiday, I will come back on the 3rd of January. So I could look into those feature requests then. But event if I do it might take a while for me to implement them since I'm sure I'll have a ton of work pilled up once I am back.
If you know how to code I would recommend you give it a shot implementing this yourself, it will also help you familiarize yourself with the asset. If not I'm afraid you will have to wait until the next update.
 
Hi Sangemdoko,
I finished 2 and 3 and they seem to work well.
For the 1st issue, I'm using ItemTransactionCollection as the Main collection, and also adding ItemCollectionRestrictionSetObject to the inventory. My plan is untick Deactivate On Interact option in the ItemPickUp component and deactivate the object if the items were added to the player's inventory successfully.
Itempickup3.png

But I met a problem that the items are always added to the ItemTransactionCollection and then got rejected after the OnPickupSuccess event was called. That means if using ItemTransactionCollection the OnPickupFail event on the ItemPickUp component will never be called even the items will be rejected by the target collections.
itempickup2.jpg
 
But I met a problem that the items are always added to the ItemTransactionCollection and then got rejected after the OnPickupSuccess event was called. That means if using ItemTransactionCollection the OnPickupFail event on the ItemPickUp component will never be called even the items will be rejected by the target collections.
That's odd, I remember overloading the CanAddItem function to check if the transition collection can move the item to another collection before it accepts to add.
I'll add this to the things I need to review once I am back.
 
Top