question

calentine avatar image
calentine asked

Can i add stats through cloud script instead of having to do it manually on the playfab server?

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.

Seth Du avatar image Seth Du ♦ commented ·

Yes, but may I know the detailed scenario? Adding Statistics will still need to call UpdatePlayerStatistics API in Cloud Script function, while I am not sure of the meaning of "do it manually on the playfab server".

0 Likes 0 ·

1 Answer

·
calentine avatar image
calentine answered

What I mean is can I send a String as the name of the Statistic along with a float/int value, ie) strength, 50 without listing strength in playfab first. I just want to make sure I can do this dynamically rather than having to list the stat in plafab before accessing it. I want to be able to basically send the stat name and value and if it exists I can add/change that stat and if it does not I can create it on the fly.

Thanks again @SethDu

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.

Seth Du avatar image Seth Du ♦ commented ·

UpdatePlayerStatistics API will create a new leaderboard when the statistics doesn't exist in the title, hence you don't need retrieve the data before the update.

Since there is a limit for the number of statistics that can be defined in a title, when you create this cloud script, please make sure all the statistics are pre-defined and players are not able to interfere the update progress.

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.