question

Jon avatar image
Jon asked

Changing ItemClass breaks existing items

How to reproduce:

1) Create item with ItemClass (itemId: 0, itemClass: Weapon)

2) Grant item to player

3) Change the ItemClass via dashboard (ex: Sword)

4) Call GetInventory

5) returned result will say something like {itemId: 0, iteminstanceId: xyz, itemClass: Weapon}

Expected result would be Sword?

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

This behavior is by design. Changing the catalog item’s attributes wouldn't affect the inventory instance items granted before the modification. If you want to change the instance item’s class, please revoke the original one, then grant a new one to the player after the modification. Or you can add the custom data for the corresponding instance items using this API Server.UpdateUserInventoryItemCustomData. For clarification, UpdateUserInventoryItemCustomData can't change the instance item's attributes too. It's a workaround to add some information to the granted inventory items.

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.