question

rima avatar image
rima asked

How to Set Max Quantity on an item?

I can't find the Option to Limit an Item Quantity Per Player. So a Player can only Hold an X Amount of this Item Type.

In Our case we want the players to only have 1 quantity of an item type. E.g Pack , Pass/Ticket.


If there is no option to enforce, Let's say if we enable Stackable , Would all the items of that type have the same item instance in the inventory?

E.g Player Purchases 2 of Item X (Stackable) . Would the 2 of the X Item in the Inventory have the Same item Instance Id?

Player 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

·
Seth Du avatar image
Seth Du answered

There is no built-in support for this feature, and the limit feature of the item in PlayFab Catalog works globally. Please feel free to send a thread on Feature Requests forum --https://community.playfab.com/spaces/24/index.html.

The workaround solution is first to store the Max quantity along with item ID somewhere else, for example, Title Data, static values in Cloud Script/Azure Function. Then restrict the methods that players can access this item, and it is recommended to implement Cloud Script/Azure Function to handle the purchase process so that the function will firstly check the Max Quantity and compare with the player’s inventory. Then the item can be granted.

>>Player Purchases 2 of Item X (Stackable)

They will be stacked in the same item instance and there will be only one instance ID.

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.

rima avatar image rima commented ·

Hey

Yeah we were also thinking about enforcing a limit by manually checking player inventory then granting it. but We were just concern about querying the Player inventory Every time we are granting a new time.


Thanks a lot for the answer.

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.