question

oglazirin avatar image
oglazirin asked

Assign default Player Statistic value on new account creation

Hello everybody!

I'm trying to implement skill-based matchmaking by using Photon and PlayFab. I want to store player's elo (rank) as a PlayFab statistic.

How can I assign a default value for player's rank when a new account is created? I know this should be possible with CloudScript, but how can I know from CloudScript when a new account is created? Maybe you could point me to some code example?

Thank you!

CloudScript
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

·
Joshua Strunk avatar image
Joshua Strunk answered

You have a couple options for triggering this kind of CloudScript.

Use PlayStream and setup action to trigger on player_added_title.

Can do this through Automation -> Rules -> New Rule

-

Setup an ExecuteCloudScript call for when users login.

In your game after a user logins call into CloudScript using Client.ExecuteCloudScript. This CloudScript would could us a UserInternalData key/value that contains info about what last game/backend version the previous login was on and make appropriate changes to the account to update it. There is an example of this kind of CloudScript

Video example from PlayFab: https://youtu.be/ClcPV61qt5I?t=834

-

Personally I would go with option two as it will always give you the option to update already created accounts whenever need as they login.


d8zny.png (85.0 KiB)
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.

oglazirin avatar image oglazirin commented ·

Great answer @Joshua Strunk!

Thank you!

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.