Microsoft Azure PlayFab logo
    • Multiplayer
    • LiveOps
    • Data & Analytics
    • Add-ons
    • For Any Role

      • Engineer
      • Designer
      • Executive
      • Marketer
    • For Any Stage

      • Build
      • Improve
      • Grow
    • For Any Size

      • Solo
      • Indie
      • AAA
  • Runs on PlayFab
  • Pricing
    • Blog
    • Forums
    • Contact us
  • Sign up
  • Sign in
  • Ask a question
  • Spaces
    • PlayStream
    • Feature Requests
    • Add-on Marketplace
    • Bugs
    • API and SDK Questions
    • General Discussion
    • LiveOps
    • Topics
    • Questions
    • Articles
    • Ideas
    • Users
    • Badges
  • Home /
  • General Discussion /
avatar image
Question by ludovicsadri-faure · Jun 14 at 10:52 AM · In-Game EconomyPlayer Inventory

Bonus items on first bundle purchase

We wish to add a feature to some of our bundles, and I'm not sure how to do it.

Basically, we want to give (for example) bonus items the first time each player buys the bundle.

I didn't find a similar feature in the bundles page, and I believe there's currently no API endpoint to access a player's purchase history (to check whether they have already bought the bundle or not)

My current workaround idea is something like this:

Create a player statistic for each affected bundle.

Create a rule that increments the statistic when the player buys the bundle (or when the bundle item is added to their inventory).

Create another rule that gives the bonus items when the statistic is changed and its new value is 1.

Obviously this is not an ideal way to do it. Is there anything I'm missing to make it better?

Thanks.

Comment

People who like this

0 Show 0
10 |1200 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users

1 Reply

· Add your reply
  • Sort: 
avatar image
Best Answer

Answer by Gosen Gao · Jun 15 at 06:42 AM

For the feature to give additional items the first time players purchase a bundle, I think the most important part is to store the status information whether the bundle was purchased for the first time or not. Since Statistic has a maximum limit of 300, “Create a player statistic for each affected bundle” may take some resources. I would recommend that you can use Player Data to store the status all in one key/value pair. The workflow should be something like below.

  • 1.Create a Key/Value pair in Player Data to store the list of purchased bundles.
  • 2.Create a Rule to execute a Cloud Script when the bundle is added to the inventory.
  • 3.In that Cloud Script, you can check if the current bundle is in the list. If not, give the player additional items, and add the current bundle to the list.

BTW, if not all of the bundles need such a feature, you can either edit the rule to restrict condition to specify which bundles will trigger the rule, or you can change the data structure of that Key/Value pair to store more info to meet your needs.

Comment

People who like this

0 Show 1 · Share
10 |1200 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image ludovicsadri-faure · Jun 15 at 02:37 PM 0
Share

Thanks for your answer, I thought about using PlayerData but ideally I'd like to do it without using Cloud Script functions, and we won't reach the Statistics limit of 300 anytime soon.
It seems there's no easy way to achieve this feature, so I'll try using Statistics and keep your suggestion in mind if needed.

Your answer

Hint: You can notify a user about this post by typing @username

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Navigation

Spaces
  • General Discussion
  • API and SDK Questions
  • Feature Requests
  • PlayStream
  • Bugs
  • Add-on Marketplace
  • LiveOps
  • Follow this Question

    Answers Answers and Comments

    13 People are following this question.

    avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image

    Related Questions

    Limiting the Number of Specific Items in the Inventory?,Limit Number of One Type of Item in Inventory? 1 Answer

    Inventory items are being auto added once a day 1 Answer

    Video Tutorial or Guide to Implement Real Money Purchase 1 Answer

    Catalog item with more states 2 Answers

    Player purchased an item bundle but the contents weren't given to the player 1 Answer

    PlayFab

    • Multiplayer
    • LiveOps
    • Data & Analytics
    • Runs on PlayFab
    • Pricing

    Solutions

    • For Any Role

      • Engineer
      • Designer
      • Executive
      • Marketer
    • For Any Stage

      • Build
      • Improve
      • Grow
    • For Any Size

      • Solo
      • Indie
      • AAA

    Engineers

    • Documentation
    • Quickstarts
    • API Reference
    • SDKs
    • Usage Limits

    Resources

    • Forums
    • Contact us
    • Blog
    • Service Health
    • Terms of Service
    • Attribution

    Follow us

    • Facebook
    • Twitter
    • LinkedIn
    • YouTube
    • Sitemap
    • Contact Microsoft
    • Privacy & cookies
    • Terms of use
    • Trademarks
    • Safety & eco
    • About our ads
    • © Microsoft 2020
    • Anonymous
    • Sign in
    • Create
    • Ask a question
    • Create an article
    • Post an idea
    • Spaces
    • PlayStream
    • Feature Requests
    • Add-on Marketplace
    • Bugs
    • API and SDK Questions
    • General Discussion
    • LiveOps
    • Explore
    • Topics
    • Questions
    • Articles
    • Ideas
    • Users
    • Badges