question

Ozan Yilmaz avatar image
Ozan Yilmaz asked

Is there a way to give random amount of virtual currency to players via containers?

Hello everyone,

Is there a way to give random amount of a virtual currency to a player via containers? For example; the players can get 2 common skins and 1 rare skin as well as gold between 10 and 20. The amount of gold will be randomized.

I can do this over a cloudscript by using drop tables and generating a random number, but I wonder if PlayFab has a feature for this.

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

·
Citrus Yan avatar image
Citrus Yan answered

It’s possible, however, it doesn’t sound like a efficient way. Anyway, here is the plan:

  1. Create 11 Consumable (by time) Bundles, each one contains gold from 10 to 20 respectively.
  2. Create a Drop Table that consists the aforementioned 11 Bundles.
  3. Create a Container that holds 2 common skins,1 rare skin and the Drop Table above, when unlocked, it will add those items and a randomized number (10 to 20) of gold into the players inventory.

The inefficient part is that you’ll need to enumerate all possibilities between 10 to 20 and reflect that into 11 Bundles, and, it won’t scale well if you ever want to randomize a wider range, e.g. 10 to 100. Therefore, using CloudScript might be more efficient. Moreover, If you adopt a looser randomization e.g. {10, 15, 20} instead of {10..20}, the above plan might be worthy of consideration.

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.