question

jonaslasan avatar image
jonaslasan asked

Get Container/Bundle content

I have created in game sales and defined them in PlayFab as Container / Bundle. I have had no luck yet on how to get items inside container to display them in-game dynamically.

10 |1200

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

1 Answer

·
brendan avatar image
brendan answered

Can you clarify the user flow and what you're attempting to do? Bundles are items that come with other items included. Containers are items that have other items "inside" which are not added to the player inventory until the Container is opened. In both cases, if one of the sub-items is a Drop Table, the specific item that the Drop Table entry resolves to is determined when that sub-item is added to the player inventory (so, when the Container is opened or the Bundle added to the player inventory). In all cases though, you can get the list of all items in the catalog with the GetCatalogItems API call.

3 comments
10 |1200

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

jonaslasan avatar image jonaslasan commented ·

Thanks for the reply. I have created a sale system where I don't want to implement sales with a lot of modifications or hardcoded stuff, I simply create a container, put items in it and give it a tag "sale" so it is recognized by the code. Then when user buys that sale, all items inside container are given to the player. Container is perfect for my scenario, but there is no simple function "GetContainerInfo" form Client API. I need to get every itemID inside the container to display them as icons in sale viewer.

0 Likes 0 ·
brendan avatar image brendan jonaslasan commented ·

When you call GetCatalogItems, the contents of a container are all listed in the Container property. You can parse that part of the JSON to get all the info on the items, drop tables, and virtual currencies the Container holds.

1 Like 1 ·
jonaslasan avatar image jonaslasan brendan commented ·

Thanks that solves the problem! I was checking GetCatalogItems Sample Request and didn't see that property before.

0 Likes 0 ·

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.