The integration file has a new home on Github. Please make sure you grab the latest version of the file before you continue.
In previous posts, I showed how to get the store items and virtual currency. In the final part of the store items posts, I’ll detail the steps to retrieve the user’s inventory and how to purchase an item.
To retrieve the player inventory create a table called “userInventory”. If you are using the default configuration you are going to need a table with 3 columns. All the columns should be text.
You can change this as usual in the configuration but for now, the RemainingUses has to stay as column 3, and column 1 should be the ItemId. You can change the value of column 2 and add any columns you wish past column 3.
Here is what the default configuration looks like.
To purchase an item all you need to do is call TweetSheet behavior with the name of the id of the item. In my implementation, I dynamically determine this by actor properties that reference the store items table. The item has to be in the store items table for this to work.
If it is successful, Playfab will update both the virtual currency amount and the inventory items and the integration file will make the appropriate updates to the tables of rows corresponding to those.
Created a short video to show it working: