question

doronhn avatar image
doronhn asked

what is best way to update "Power Up" \ "Gold" from mobile game to playfab player data?

hey,

what is best way to update "Power Up" \ "Gold" from mobile game to playfab player data?

Player DataCloudScript
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

·
JayZuo avatar image
JayZuo answered

Hi Doronhn,

Could you please specify what are the "Power Up" and "Gold"? For different data types, there will be different ways. For example, "Gold" sounds like a virtual currency. If so, then you better use Currencies instead of player date. However, generally, you can always update player date like in this document: https://api.playfab.com/docs/tutorials/landing-players/using-player-data.

6 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.

doronhn avatar image doronhn commented ·

hey,

thanks for the answare, well first of all you are right, gold is kinda currencie. i am not sure what currencies are used in the link you send me but i will read about it.


my question was not "how to save" , but "how to update" thats mean if user has just collect "power up" how do i update playfab that he did so? so the next time he logs in he will see the right data for him?

is it with client call? cloud ?

thanks

0 Likes 0 ·
Andy avatar image Andy ♦♦ doronhn commented ·

There are many types of player data and many ways to update them. If a "power up" is an item, then you could call PurchaseItem from a client or GrantItemsToUser from Cloud Script. If "power up" is less an item and more of a persistent piece of player state, then you could use UserData. That is written with UpdateUserData. I'd strongly recommend reading through the link JayZuo posted and becoming familiar with how player data works.

0 Likes 0 ·
doronhn avatar image doronhn Andy ♦♦ commented ·

i know how player data works, i read it few times and use it to store some values on a player such as "current level".

i will try to elaborate the process is like this:


in this puzzle game i create player need to fill out the board. some levels are difficult and there for every player has "power ups" which he can collect from time to time or buy them in the shop.

for every player i have to store the details of how many power ups he has and which type (there is four types).

-remember he can collect them not only from the shop, he also can collect them from the game board in some levels.

after the user collect the power up, i need to update the user data that's stored on PlayFab.

i hope now its gave you more details.

0 Likes 0 ·
Show more comments

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.