Hello, I want to make an item that have limited amount so the item can be sold out. But using the limited item feature can only be use for RM. I've tried using custom data in the item and update the amount/custom data by cloud script, but cloud script can't use admin function to update catalog items. What do you think is the best method for this?
Thanks
Answer by Sarah Zhang · Jan 16, 2020 at 05:37 AM
If the “limited item” that you said means all users under the title share one limit of this item. For example, the total number of purchases by all users cannot exceed 10. If so, although items that check [LIMITED EDITION] option can only be purchased by RM, you still can let players purchase such items with VC through some workarounds. A possible workaround is to combine Server API GrantItemsToUser with Server API SubtractUserVirtualCurrency. Limited Items can be granted to users by server or admin API GrantItemsToUser(s), SubtractUserVirtualCurrency can be used to decrement the user's balance of the specified virtual currency by the stated amount. These two Server API can be accessed by CloudScript directly. Then you can write a custom CloudScript function to handle the process of purchase.
If you want that every user has a separate limit of it. For example, everyone can purchase at most 10 items. If so, you can choose “TitleData” to store the “initial limit number”, and choose “Player Read-Only Data” to store the “Items remaining”. Server API GetUserReadOnlyData and UpdateUserReadOnlyData can be used to do the judgment and update the “item remaining”. They also can be used on CloudScript with your custom code logic.
Thank you for the thought
The limited items is for everyone and I want to show the number of item left. I also thought to use the [LIMITED EDITION] way. But I thought if it can disturb the dashboard/analysis if I use item with RM. Also, if I want to get the items stock, I need to use the admin API in my project. But if there's no other way, I think I'll just stick with your idea.
Thanks
Yes, currently, only can use Admin API CheckLimitedEditionItemAvailability to check the global count for the limited edition item. It's not recommended to use it on CloudScript or clients, if you have a custom admin tool, you can use admin API on it. Besides, right now, to manage such global data that need to be updated frequently(more than limited edition item), an external cache like Redis still is a recommended workaround.
Hi, I've implemented it and use RM, but I get this OperationNotSupportedForPlatform 1219 when I tried to buy the item. Any idea how to fix this?
Time Locked Items 3 Answers
How to get contents from DropTable trough Client API? 1 Answer
Changing the price of an item using CloudScript? 1 Answer
Subscriptions in PLayfab... 1 Answer