Hi,
I was following this document for understanding Catalogs, Items, Bundles and drop tables. Everything was fine in the document until I found this section where there is no help provided regarding API calling and Unity code.
So, my main concern is which function I will use to use this feature and to call this 11-Item drop bundle?
Thanks!
Answer by Sarah Zhang · Nov 29 at 05:53 AM
>> I was following this document for understanding Catalogs, Items, Bundles and drop tables. Everything was fine in the document until I found this section where there is no help provided regarding API calling and Unity code.
Game developers only can access drop tables programmatically using these two PlayFab Server API methods: GetRandomResultTables, EvaluateRandomResultTable. Only when you develop a game server on Unity, you need to call these two functions via PlayFab Unity SDK. Otherwise please call them on the Custom Game Server or CloudScript. This section Using drop tables shows how tocall these two API via PlayFab C# SDK on a C# server. If you want to build a Unity server, you can navigate to [Unity]->[Window]->[PlayFab]->[Editor Extensions], choose [Settings]->[API] tab, check [ENABLE SERVER API], then you can call server API on Unity. If you only use Unity to develop client applications, please don’t check [ENABLE SERVER API].
>> So, my main concern is which function I will use to use this feature and to call this 11-Item drop bundle?
If you want to use bundles in a drop table, please refer to the above content. If you want to grant or let players purchase a bundle directly, you can handle the bundle like an item. A bundle also has an item Id, it can be used in API about items. You can refer to the above content to use server or admin API GrantItemsToUser to grant items or bundles to users, or use client API PurchaseItem, let users purchase it.
>> If you want to use bundles in a drop table, please refer to the above content. If you want to grant or let players purchase a bundle directly, you can handle the bundle like an item. A bundle also has an item Id, it can be used in API about items. You can refer to the above content to use server or admin API GrantItemsToUser to grant items or bundles to users, or use client API PurchaseItem, let users purchase it.
I want to achieve the randomness as told in the tutorial I followed. For that which API should I use GrantItemsToUser or PurchaseItem?
Yes, GrantItemsToUser can be used to grant bundles, PurchaseItem can be used to purchase bundles. And the key point of implementing the randomness is adding drop tables in the bundle, please follow the tutorial normally, especially this part Adding a bundle. Then call the API to grant or sell the bundle which you set.
@Sarah Zhang Alright, got it. I have already created the bundle containing multiple drop tables just like the tutorial and now I will try the mentioned APIs and see if it works for me. Thanks!
Saving long text data in one UpdatePlayerData call? 2 Answers
How to download content from cdn? 1 Answer
C# server SDK in Unity 0 Answers
Unable to update PlayFab Unity SDK 2 Answers
Thunderhead port does not open 1 Answer