question

llsjoybox avatar image
llsjoybox asked

How to make level upgrade item in player's inventory

1) I want to make level upgrade item, like card in Clash Royale. Each next upgrade of the item must increase in the value of these "card" and currency. Item "card" is stackable and durable.

clashRoyaleExample1.png

How can I make it possible to track the purchase price of the next card level?

Where should I store the table of values for each card level?

Level 1 - 1 card 10 currency

Level 2 - 2 card 20 currency and etc.

This information must be available to the player to view and purchase

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

·
Citrus Yan avatar image
Citrus Yan answered

Each Item defined in the Catalog has its own Custom Data, which is global for all the players (use GetCatalogItems to retrieve such info), you can use that to store the information (each level’s value, price, etc.) about a specific item, please check out this doc for more details:

https://docs.microsoft.com/en-us/gaming/playfab/features/commerce/items/catalogs#new-catalog-item-fields

And, separately, each item instance in player inventory also has its own Custom Data, you can use that to keep track of the current level of an item owned by a player.

https://docs.microsoft.com/en-us/rest/api/playfab/server/player-item-management/updateuserinventoryitemcustomdata?view=playfab-rest

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.

llsjoybox avatar image llsjoybox commented ·

Тhanks!


Would it be good to use "Content - Title Data" for storing public information on static data? In order not to store this information in the "Catalog - Custom Data".

Upgrade Level 1 - need 1 card 10 currency

Upgrade Level 2 - need 2 card 20 currency and etc.

0 Likes 0 ·
Citrus Yan avatar image Citrus Yan llsjoybox commented ·

Sure, you can use Title Data for configuration/static data of your title.

0 Likes 0 ·

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.