question

Brian Choi avatar image
Brian Choi asked

Is there way to copy 'CustomData' of catalog item to 'CustomData' of inventory item

Hi,

I need to know that there is way to copy customData from catalog to inventory item when user purchase item.

Of course without writing cloud script. because I want make item progress like level, exp and etc..

Is there way to do that?

Brian Choi,

Player DataPlayer Inventory
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

·
Sarah Zhang avatar image
Sarah Zhang answered

A feasible solution is to get the Catalog Item CustomData via GetCatalogItems then update the corresponding Inventory Item CustomData manually. This Server API UpdateUserInventoryItemCustomData can be used to update the custom key-value pair data tagged to the specified inventory item, which is read-only from the client. But because of only this API can update the inventory item custom data and it is server API, we would recommend you write CloudScript functions to call it unless you have a custom server. After you write a CloudScript function, clients can execute this function via client API ExecuteCloudScript.

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.

Brian Choi avatar image Brian Choi commented ·

Yeah, I was trying to do that using CloudScript but I need to update customData of several items at the same time. as you mentioned. but I changed plan to save it at user customData as json. Anyway Thanks.

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.