question

Max Guernsey, III avatar image
Max Guernsey, III asked

Is there a way to create container instances with specific contents on a per-instance basis?

A lot of games have the ability to double or triple the rewards gained from a play cycle if you watch an ad and I would like to implement this in as server-authoritative a manner as possible.

It seems like what I would want is to create a container with X (the reward amount) coins in it and then open it if they watch an ad. However, it looks like containers have to have predefined items (or potential items in the form of a drop table).

An alternative that comes to mind is to create an entity object that writes down how many coins should be rewarded, then have an endpoint in my server that redeems it upon completion of the ad.

What is the preferred/recommended way to use PlayFab as part of a transient reward cycle?

entitiesIn-Game EconomyPlayer Inventory
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

Contents (Items or Currencies) opened in a container must be predefined, you cannot have a container unlock specific contents that’re not previously defined. In your case, you can utilize our built-in Rewarded ads feature to implement your use case. Instead of opening a container upon completion of the ad, you can execute a custom Cloud Script/Azure Function to grant any contents you specify for the players. For more details, please see: https://docs.microsoft.com/en-us/gaming/playfab/features/automation/rewarded-ads/

2 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.

Max Guernsey, III avatar image Max Guernsey, III commented ·

I still have to "write down" the amount of the reward, somewhere. After they win a game, I need a way to record how much extra they should get for watching an ad. I didn't see a way to record that in the quick start for rewarded ads.

0 Likes 0 ·
Citrus Yan avatar image Citrus Yan Max Guernsey, III commented ·

For that you can record it in entity objects or player data as you suggested above.

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.