question

simong@everguild.com avatar image
simong@everguild.com asked

Catalog/Inventory/Containers ad Bundles

Hi, here's my settings:
1 Catalog Item : "PackCards" : it's a container with 5 card item in it.
1 Catalog Item : "PackCardTicket_3" : it's a bundle with 3 PackCards in it.
1 Catalog Item : "PackCardTicket_5" : it's a bundle with 5 PackCards in it.

if I purchase a PackCardTicket_3 I can see in my inventory this item + 3 PackCards (1 succeeded with 3 Uses Left, and 2 other stacked with 1 Uses Left)

So at this moment I don't need the PackCardTicket_3 and no matter what I'm trying to do to remove it, it's always present in the inventory but deactivated. What's the process to make it disappear from the inventory?

Next I use UnlockContainerItem with the Id "PackCards" and I get granted 5 cards that are added to the inventory. The Number of Uses Left automatically decreased by 1 but I can still see the 2 other stacked with 1 Uses Left.
Eventually if I unlock all of them, the inventory item will who a Uses Left of 0, but still present in the inventory.

So How does this work exactly? How can I make sure the inventory is clean when I purchase a bundle that grants x Containers. the bundle becomes irrelevant immediately and I don't know how to remove it.
and also when I unlock all containers of the same type, I still have one with 0 Uses Left and all the other "Stacked" are still present.

Thanks

10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

brendan avatar image
brendan answered

There are a few concepts in this, so let me speak to each:

First, catalog items defined with a UsageCount are consumables. If they are containers, they will indeed be auto-decremented when you use UnlockContainer on them (if they're opened). Otherwise, you can also decrement them with ConsumeItem.

Now, stackable is also a concept in the catalog, but it re-uses the UsageCount to indicate the total number of items in the stack. So if you have an item which is stackable in the catalog, each time you grant one to the player, it will add to the existing stack.

In either case, once the UsageCount for the item instance in the player inventory reaches 0, that item will no longer be in the active inventory of the player, meaning that it will not be returned as part of the player's inventory when querying it from the API methods.

However, the player's inventory in the Game Manager is another view on this. In it, we show all items the player has ever owned, so that you have the complete history for that player. So, any stack or consumable the player had, which now has 0 left, will be visible and showing that number remaining. Also, if you Revoke items from the player's inventory, those items will also show up in the Game Manager, again so that you have the complete history.

10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

simong@everguild.com avatar image
simong@everguild.com answered

Thank you! Developer wise it would be really useful to have a view in the game manager about what the user actually has :)

10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Write an Answer

Hint: Notify or tag a user in this post by typing @username.

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.