question

Alberto avatar image
Alberto asked

How to differentiate between Durable and Consumable without relying on RemainingUses?

Is there a way to know if a Durable item its also Stackable?

To my surprise, I read that if and item has RemainingUses, it means that it is Consumable.
But at the same time if it is Stackable it also has RemainingUses, so is there a way to differentiate between Durable and Consumable without relying on RemainingUses?

10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Alberto avatar image
Alberto answered

Hi SehtDu, I don't want to dynamically change anything during gameplay, I just want to be able to differentiate between Durable and Consumable without using RemainingUses.

Adding custom KVP in item custom data doesn't seem like a very robust solution, as I have hundreds of items in the store. I would like to rely on PlayFab's API and not in a custom string written by me manually. That would be very fragile and has to be hardcoded into my framework, making it not extendable.

Adding an IsDurable field to PlayFab's API would be a great addition that's being missing for years...

1 comment
10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Seth Du avatar image Seth Du ♦ commented ·

I think refer to this requirement, you can send a thread on Feature Request forum if there is no existing one. Otherwise, there should be predefined database for reference.

0 Likes 0 ·
Seth Du avatar image
Seth Du answered

In the common scenario, Catalog is not the resources that should be dynamically changed during the gameplay, and it updates along with the client version updates. Hence, in terms of your requirement, I will suggest maintaining a local copy of catalog via GetCatalogItems API and adding custom KVP in item custom data to mark whether it is Consumable or Durable.

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.