question

llsjoybox avatar image
llsjoybox asked

How get custom data on expired item in player inventory?

The player's inventory contains items is stackable. In custom data, I store information on the level of an item's upgrade.

Using ModifyItemUses I decrease the "uses left" of this item and change the custom data of this item. But if "uses left" becomes 0, then this item will become Expired. When you call up the player's inventory information, this item will not appear. But if "uses left" becomes greater than 1, then the item will become active again with the same custom data.

How can I always be able to receive information about items (even Expired)?

It is important for me to know were (are now) these items in the player. Do I need to duplicate information on open items for example in Player Data?

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

·
Rick Chen avatar image
Rick Chen answered

It is not possible to get the custom data of an expired item. There needs to be at least 1 use count for a stackable item in order for you to get the custom data. In your scenario, I suggest making the use count of a stackable item a relative number. For example, use count 1 in PlayFab represents use count 0 in your game and the use count in PlayFab is always greater than use count in your game by 1. Then, to make sure the use count in PlayFab is never below 1, you could add some logic before calling ModifyItemUses API in CloudScript or your server.

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.