question

Hotpopot avatar image
Hotpopot asked

How to get Catalog Item Custom data quickly?

In my game when granting item to user

now the workflow is:

1) use EvaluateRandomResultTable to get ItemId;

2) use GetCatalogItems to get the List of the Catalog Item Instances;

3) travel the List use ItemId to find the target Item Instance;

4) get the target Item Instance custom data;

5) use the custom data fill in GrantItemsToUsers.ItemGrants.Data Fields to create Inventory Item Instance;

so my question is :

is there a faster way to get the target than 2)3)?

3 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.

Hotpopot avatar image Hotpopot commented ·

fix the workflow 5)

use the custom data as base-data to get ramdom custom data, in order to make every Inventory Item Instance have different custom data.

0 Likes 0 ·
Seth Du avatar image Seth Du ♦ Hotpopot commented ·

May I ask what programming language/platform you are using?

0 Likes 0 ·
Hotpopot avatar image Hotpopot Seth Du ♦ commented ·

Playfab cloud script , language is javascript

0 Likes 0 ·

1 Answer

·
Seth Du avatar image
Seth Du answered

I think the iteration is a must. Normally catalog data and inventory data can be stored locally in your clients. Only when changes happen, will the server verify the action then perform it. A sync process will refresh the local data in your clients. Those item IDs and instance IDs are retrieved via players' clicks on the GUI. However, to retrieve the Custom Data of an item instance, you still need to traversal the inventory.

Thus, you still can change the storage structure of your data, for example, if the data you are using seldom changes, you can use Title Data(Title Internal 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.

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.