question

Russ Glaeser avatar image
Russ Glaeser asked

Initial character creation on first login

This seems like such a basic scenario I must be missing something. This started with investigation into setting up a player inventory.

Looking at the docs, it sounds like I need to create a character for the user first. To do that I need to create a catalog item representing a 'character', and then write a CloudScript function in javascript (ick) to call the server api GrantCharacterToUser which grants the catalog item, and finally trigger a PlayStream Event (com.playfab.player_logged_in) to call the CloudScript function.

Is this really the best way to do this? It seems super complicated for such a common scenario it really makes me think I missed something important somewhere.

Thanks for any help.

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

No. To be clear, the character creation token in inventory is for player self-service character creation (using Client API GrantCharacterToUser). Meanwhile, the server API GrantCharacterToUser is directly creating a character for a specific player without any item consumption.

“com.playfab.player_logged_in” is generated every time when a successful login. Characters won’t have login events.

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.

Russ Glaeser avatar image Russ Glaeser commented ·

Thanks for the reply, but I wasn't asking about granting the user a token so they can unlock a character on their own. My question was about unlocking a character server-side via CloudScript and PlayStream.

To answer my own question, yes I was missing something fundamental. I didn't see the call for PlayFabClientApi.GetUserInventory()

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.