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!
Answer by Brendan · Sep 28, 2017 at 02:31 AM
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.
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)?
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.
Ah, I didn't register that the linked thread was leveraging UsageCount. Gotcha. Thanks!