question

Ben R. avatar image
Ben R. asked

Way to see if an ItemInstance is consumable or not.

Hi, is there really no way to see if an ItemInstance is consumable or durable? If not I'd like to request adding a flag IsConsumable or something similar!

10 |1200

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

brendan avatar image
brendan answered

Yes, if the item has a RemainingUses, it can be consumed.

2 comments
10 |1200

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

Ben R. avatar image Ben R. commented ·

Hey Brendan, thanks for the reply ... I'm really not a fan of this as a 'solution' as it's so non-intuitive, doesn't match the dashboard setup.

It also feels like really fragile API design to rely on a secondary property to work out the first. What if PlayFab in future adds an item class that's durable with charges? Like a wand that can be used 20 times, or to model durability on an item.

/my2c

0 Likes 0 ·
brendan avatar image brendan Ben R. commented ·

Actually, the scenarios you describe - durability on items and number of charges on an item - are simply specific implementations of RemainingUses. There's nothing about those that would be incompatible, unless you want to have a special case of zero uses remaining - in which case, you could just code that to be when there's one use remaining. If there's something specific you'd like to see us add to the inventory return data, I'd recommend adding that to our Feature Requests forum. We use that as a way to track on things that are valuable to our community in general, by monitoring how many users "like" any given idea.

0 Likes 0 ·
Ilya Novikov avatar image
Ilya Novikov answered

Hello @Brendan. Can you then explain about stackable durables? My test shows that they:

1) Have RemainingUses.

2) Can be consumed.

What is the purpose of having them? How they differ from consumables with count = 1?

,

Hello @Brendan. Can you then explain about stackable durables please? My test shows they:

1) Have RemainingUses.

2) Can be consumed.

Do they have any purpose? Is there any difference between them and consumables with count = 1?

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.