question

Anisimov Arthur avatar image
Anisimov Arthur asked

Item's price depending on the number of items

Hey,

I want to make a system where the price of an item will depend on the number of items in the inventory (for example I will search by tag).

I have one sword – price for all swords is 1.
I have two swords – price for all swords is 2. etc...

I am unable to make it on the client because I will get 'WrongPrice' error.
What is the best way to make it?


Thanks,
Arthur

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

·
Seth Du avatar image
Seth Du answered

It is not supported natively by PlayFab and this is a feature that Catalog doesn’t have. However, it can be achieved easily via Cloud Script/Azure Function. Players may send the item ID and quantity as parameters in the request so that Cloud Script/Azure Function functions can calculate the result, grant items, then subtract Virtual Currency at the end.

In addition, you may also consider displaying the required VC on GUI (the calculation is done on the client locally).

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.