question

mike avatar image
mike asked

Can't consume item that was originally created & instantiated as durable?

I have a catalog item that was originally (accidentally) create as a Durable item, but has since been changed to a Consumable (by Count).

However, if I try using the ConsumeItem method on this item, I get this error:

{
  "Level": "Error",
  "Message": "PlayFab API request error",
  "Data": {
    "api": "/Server/ConsumeItem",
    "request": {
      "PlayFabId": "49A98437AB76415A",
      "ItemInstanceId": "BD5091B722892D38",
      "ConsumeCount": 1
    },
    "result": null,
    "apiError": {
      "code": 400,
      "status": "BadRequest",
      "error": "InvalidItemProperties",
      "errorCode": 1091,
      "errorMessage": "Item is not consumable.",
      "errorHash": null,
      "errorDetails": null
    }
  }
}

I have verified that the catalog item in question is now Consumable, but maybe since it was granted to a player while still being a Durable, it's causing this error?

As a side note: I've tried to revoke some of these items from the player's inventory using Game Manager, but sometimes I get "Bad Request" and can't revoke the item:

This happens when the instance is "Stacked". Is this a bug? Shouldn't I be able to revoke any item from Game Manager?

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

·
brendan avatar image
brendan answered

When an item instance is created in the player inventory, all the base setup for the item is determined at that time. So, consumable or durable, stackable or non-, all those things are determined when the instance is created. Changing the catalog to make a durable into a consumable will mean that all new instances going forward will be consumable, but it will not change existing instances. What you could do is have a Cloud Script handler that checks for those items, revoking the ones you need to get rid of and granting new ones, making sure to limit it to 5 or so, and call that from the client on login - that would clean them up progressively as the player signs in.

For the revocation of items, those items listed as "Stacked" are no longer active in the player inventory. In fact, they've were archived right after adding their usage count to the main stack. So there's no need to revoke them. The fact that they currently appear on the main inventory list for a player in the Game Manager is an error with the recent Game Manager update, and we'll be cleaning up those lists shortly.

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.