question

julianmsmith1 avatar image
julianmsmith1 asked

Add running count every time any player presses the same button. Like a limited store item or something where only 10 users could purchase one before it's sold out.

I have tried experimenting with Title Data for this but I keep seeing that Title data is not supposed to be used this way. If I could update title data using c# that would be ideal. Here's the code I was trying to use but I keep getting an error when I call "new SetTitleDataRequest" If anyone has any ideas that would be great!

PlayFabServerAPI.SetTitleData(new SetTitleDataRequest

{

Key = randomLink,

Value = linkKey + " / " + Int32.Parse(values[1])

},

result => Debug.Log("Set titleData successful"),

error => {

Debug.Log("Got error setting titleData:");

Debug.Log(error.GenerateErrorReport());

}

);

apisIn-Game EconomydataContent
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

·
Xiao Zha avatar image
Xiao Zha answered

Since changes of Title Data may take up to fifteen minutes to apply, so Title Data should not be used to store frequently modified data, such as number of remaining items, it works best as Global Constant/Static Data.

We recommend to use an external database to implement such feature. In addition to this, there is a more cumbersome method: there is an option called IsLimitedEdition in catalog item interface. This option can enforce a limited supply of the item. But the limited edition items cannot be purchased, it must be granted, so you can combine Azure function with GrantItemsToUser to implement purchase function. In addition, the number of limited edition items can only be obtained by admin API CheckLimitedEditionItemAvailability.

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.

julianmsmith1 avatar image julianmsmith1 commented ·

Hey thank you for the quick reply! I figured Title Data shouldn't be used for this and the IsLimitedEdition option seems like it could be perfect. Do you know if I would be be able to update the item or change it from the playfab website like you could do with Title Data?

0 Likes 0 ·
Xiao Zha avatar image Xiao Zha julianmsmith1 commented ·

You can update the item or change it from the playfab website like the normal item. But if you want to increase the number of the Limited Edition Items in code, you must call Increment Limited Edition Item Availability API.

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.