Features
Games
Add-ons
Docs
Pricing
Forums
Blog
Log in
Sign Up

Features

Games

Add-ons

Docs

Pricing

Support

Blog

Log in

Sign Up

  • Ask a question
  • Spaces
    • PlayStream
    • Feature Requests
    • Add-on Marketplace
    • Bugs
    • API and SDK Questions
    • General Discussion
    • LiveOps
    • Topics
    • Questions
    • Ideas
    • Articles
    • Users
    • Badges
  • Home /
  • General Discussion /
avatar image
Question by activedreaminc · Oct 09, 2018 at 04:28 PM · game managerPlayer InventoryCharacters

Automatically Consume Item Once Purchased

Hi everyone,

I am making a MOBA game. I managed to get store working so that players are able to purchase a Hero from store. However, at the moment the item goes directly to player inventory after purchase. I have set the Hero item to be a Token for Character Creation. Is there a way to automatically consume the item when player purchase a Hero then add that Hero to Character List that the player owned?

Thank you for your reply and support

Best Regards,

Active Dream

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 Andy · Oct 09, 2018 at 07:42 PM

While you can set items to be consumable and automatically consume after a fixed period of time, that's not going to be a complete solution for you in this case. In order to redeem an item for a character, you have to call GrantCharacterToUser (client or server version). My preference is generally to do that myself versus rely on automation.

You could, if it fits within the structure of your game, set up a rule that triggered on player_consumed_item with a matching itemId. This rule could then execute cloud script, which would then grant the character. Do be aware if you go this route, though, that cloud script executed as part of automation like this has lower limits when it comes to execution time and API call count.

Comment

People who like this

0 Show 0 · 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

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
  • Follow this Question

    Answers Answers and Comments

    2 People are following this question.

    avatar image avatar image

    Related Questions

    Managing Games levels - how to - best practice? 1 Answer

    1 Day Trial Hero Card for MOBA Game Setup in PlayFab Catalog 1 Answer

    Find users with a certain number of inventory items 1 Answer

    Creating Stackable CCG Character Inventory 1 Answer

    Time Locked Items 3 Answers

    Tickets

    Need help with a confidential issue? We've got your back!

  • Create Ticket
  • View Open Tickets
  • Stay up-to-date with the latest from PlayFab:  
    Sign up for newsletter
    Engineers
    • Documentation
    • Tutorials
    • API Reference
    • SDKs
    • Usage Limits
    PLAYFAB
    • Features
    • Games
    • Add-ons
    • Pricing
    Support
    • Forums
    • Videos
    • File a Ticket
    • Service Health
    • Blog
    About
    • About
    • Jobs
    • Contact
    • Press Room
    • Privacy Policy
    • Terms of Service
    • Acceptable Use
    • Style Guide
     
     
    Sign Up

    ©2017 PlayFab, Inc.

    ©2016 PlayFab, Inc. All rights reserved. PlayFab® is a registered trademark of PlayFab, Inc. | Privacy | Terms | Acceptable Use
    • Anonymous
    • Sign in
    • Create
    • Ask a question
    • Post an idea
    • Create an article
    • Spaces
    • PlayStream
    • Feature Requests
    • Add-on Marketplace
    • Bugs
    • API and SDK Questions
    • General Discussion
    • LiveOps
    • Explore
    • Topics
    • Questions
    • Ideas
    • Articles
    • Users
    • Badges