question

John Peterson avatar image
John Peterson asked

Granting a Bundle creates an ItemInstance of the Bundle?

Title ID: 44B1

Dear PlayFab community,

As per this link, I think I understand (and have empirically discovered) that granting a player a bundle will result in the bundle itself residing the player's inventory (even if it has a usage count of 1).

However, like the poster of that link, I'd like to grant the items from a bundle and not have the bundle instance itself in the inventory.

What is the recommended "best practices" to accomplish that task? Maybe a server-side CloudScript that would take a BundleID, grant it, and then find that instance in the inventory and revoke it? Or maybe determine if the ItemID is a Bundle, retrieve the contents of the Bundle, and grant only those items? These approaches seem a little...cumbersome. I'm hoping there's an easier/better way.

Thanks in advance for any help anyone can provide!

apisCloudScriptIn-Game Economy
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

Correct - a bundle is an item that comes with other items included. It is, itself, an item. To have the bundle clean itself up after adding the items it comes with, set it to have a UsagePeriod of a few seconds. That way, it'll add its "contents" to the player account, then go away.

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.

John Peterson avatar image John Peterson commented ·

Oh, okay -- setting the UsagePeriod would likely work well for me. However, I got the sense that might have issues with something (as per the details in that link)?

0 Likes 0 ·
brendan avatar image brendan John Peterson commented ·

In the linked thread, they set the Usage Count, not the Usage Period. Using the Usage Period means that the item is on a timer and will go away when you want it to.

0 Likes 0 ·
John Peterson avatar image John Peterson brendan commented ·

Ah, I didn't register that the linked thread was leveraging UsageCount. Gotcha. Thanks!

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.