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 /
  • API and SDK Questions /
avatar image
Question by Mihael Grilec · Jan 12, 2016 at 12:06 AM ·

ModifyItemUses on an item in character's inventory

Can a ModifyItemUses call be used to modify item uses in the character inventory? 

The call fails with "InvalidItemProperties: Unable to find item with id 3510550183672790558". I'm doing this call from cloudscript:

server.ModifyItemUses({
PlayFabId: currentPlayerId,
ItemInstanceId: "13AD7DC8C97EB66E",
UsesToAdd: -1
});

A users character has an inventory item with the same ItemInstanceId.

This is the item's definition:

 {
"ItemId": "extra_gold",
"ItemClass": "perk",
"CatalogVersion": "perks",
"DisplayName": "Bonus Gold",
"Description": "Cha-ching! More gold when a monster drops dead!",
"VirtualCurrencyPrices": null,
"RealCurrencyPrices": null,
"Tags": [],
"CustomData": "{\"extra_gold\":\"1\"}",
"Consumable": {
"UsageCount": 1,
"UsagePeriod": 1,
"UsagePeriodGroup": "perk"
},
"Container": null,
"Bundle": null,
"CanBecomeCharacter": false,
"IsStackable": false,
"IsTradable": false,
"ItemImageUrl": null
},
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

8 Replies

· Add your reply
  • Sort: 
avatar image
Best Answer

Answer by Brendan · Jan 12, 2016 at 12:28 AM

Not currently, but it would make sense for us to update this API call the same way we updated ConsumeItem, back when we added Characters to the service. Thanks for calling this out - I'll enter a work item to get this added. We'll update this thread when this has been done. In the near-term, you could either use ConsumeItem from the Client, or move the item from the Character to the User, and then back after the modify call.

Comment

People who like this

0 Show 4 · 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 mgambrell · Jan 19, 2017 at 12:29 AM 0
Share

I want this too...

Using playfab is like playing a scratch-off lottery game. "Scratch off one of these obvious functionalities to see if it exists or not! See if you can cobble together a working algorithm from one of the existing functionalities you uncover!"

avatar image Brendan ♦♦ mgambrell · Jan 19, 2017 at 03:12 AM 0
Share

We do have a pretty broad range of functionality, so it can be confusing working out the best way to implement features. Whenever you have questions on the best approach to a particular gameplay design, the best thing to do is to post a question detailing the question from a top-down approach - that is, what is the actual experience for the player? That way, we can work with you to come up with the best technical solution.

avatar image mgambrell Brendan ♦♦ · Jan 19, 2017 at 03:46 AM 0
Share

I wish I could work that way. Unfortunately, composing a question I'm happy with is usually equivalent to answering it myself. I don't think I would need guidance through the minefield of not-implemented-yets and on-the-client-but-not-the-servers and on-the-servers-but-not-the-clients if there weren't so many mines.

Show more comments
avatar image

Answer by office@gamednastudio.com · Apr 22, 2016 at 08:07 PM

I also need this. It's a shame that it's still not available :/

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
avatar image

Answer by Brendan · Apr 23, 2016 at 02:02 AM

We'll add this as soon as we can. Again, for now the workaround would be to use ConsumeItem from the Client API set, or to move the item from the Character to the User, modify the item usage count, and move it back.

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
avatar image

Answer by office@gamednastudio.com · Apr 23, 2016 at 09:36 AM

But these are 3 API calls instead of 1, what about Cloud Script call limit?

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
avatar image

Answer by Brendan · Apr 23, 2016 at 10:21 AM

Yes, that is one of the reasons we want to provide a way to directly change the uses remaining on a character item as soon as we can. For now, it does mean needing to use ConsumeItem, which is a single API call, or else move the item to the player, change the uses, then move it back, which would be three.

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
avatar image

Answer by Sevdanski · Nov 17, 2018 at 12:35 AM

This is really frustrating.

I just want to be able to give characters x number of stackable items. I am already having to jump the the hoop of

- loading the inventory

- figuring out which items they don't have then granting the ones they don't (just so I can get an instance id)

- use a combination of the inventory and the add items results to find the instance ids

- loop over all of the items that I want to give the character ModifyItemUses

Now I am finding that it doesn't work because I have to jump through another hoop of moving the items to the main character and back again? And it has been this way for over 2 years?

This is just adding yet another possible fail point. I can easily see some value being off and now a players items are in limbo in some other place.

I am going to have to seriously consider dropping multiple characters from our project as this just doesn't seem feasible. Its a shame because I have put a lot of effort into this.

Comment

People who like this

0 Show 3 · 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 Brendan ♦♦ · Nov 17, 2018 at 01:12 AM 0
Share

This is actually one of the reasons we're moving to the new commerce model we mentioned in the blog post (https://blog.playfab.com/blog/upcoming-roadmap-2018-q4-oct-dec-edition). That system will also support a complete UGC service which will also give you the option to let players sell their UGC for real-world money.

avatar image Sevdanski Brendan ♦♦ · Nov 17, 2018 at 01:40 AM 0
Share

Thanks for the response Brendan - as usual you guys are on top of things.

I know you guys don't like to give out dates but the blog posts states that you are hoping to have it out by December - is that still looking likely?

I only ask because I have to make some decisions about my game and I can hold off for a few weeks, but if it is going to be much longer than that then I need to start looking at alternatives

Cheers,

Andrew

avatar image Brendan ♦♦ Sevdanski · Nov 17, 2018 at 02:05 AM 0
Share

Actually, we really like giving out dates. Because if we can, that means we're on track to completion of the feature by when we're saying. When we don't, it's because we can't guarantee the date. So if we arbitrarily picked what we thought was reasonable and then missed it, we're letting down people who may have taken a dependency on that date.

The Commerce model will be in preview in December. General Availability will be in Q1.

avatar image

Answer by birbilemir · May 16, 2020 at 09:45 PM

Well its still not completed awesome :)

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
avatar image

Answer by Alex Ong · Jun 03, 2021 at 01:29 AM

Well its still not completed in 2021 June

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

    Answers Answers and Comments

    4 People are following this question.

    avatar image avatar image avatar image avatar image

    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