question

brendan avatar image
brendan asked

Character Id - use & clarification

Josh
started a topic on Fri, 03 April 2015 at 9:37 AM

I was reading your character announcement and I had some questions about the character. How does the Character Id relate the character catalog item? In the following example from the leaderboard, both users have the same characterType, but different character Ids.

        "Leaderboard": [ 
        {
            "PlayFabId": "2039475",
            "CharacterId": "9234992",
            "CharacterName": "CoolDude",
            "DisplayName": "MyUserName",
            "CharacterType": "blue_warrior",
            "StatValue": "1001",
            "Position": "0"
        },
        {

            "PlayFabId": "88887475",
            "CharacterId": "18838574",
            "CharacterName": "StrongDude",
            "DisplayName": "SomeoneElse",
            "CharacterType": "blue_warrior",
            "StatValue": "300",
            "Position": "1"

        }

Is that the intended fuctionality? How would one use a character Id?

Thanks,

Josh

10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

brendan avatar image
brendan answered

Best Answer
Brendan Vanous said on Fri, 03 April 2015 at 12:22 PM

Hi Josh,

Just like the PlayFabId, the CharacterId is automatically generated, and it's unique for all characters (across all players). It's not related to the catalog item used to create a character in terms of how it's generated, apart from the fact that the item must exist in the player inventory when the GrantCharacterToUser API call is made.

The CharacterType gets set using the ItemId from the item in the catalog. So, in our example, those characters would have been created from an inventory item instance which was of ItemId "blue_warrior".

Brendan


1 Comment
Brendan Vanous said on Fri, 03 April 2015 at 12:22 PM

Hi Josh,

Just like the PlayFabId, the CharacterId is automatically generated, and it's unique for all characters (across all players). It's not related to the catalog item used to create a character in terms of how it's generated, apart from the fact that the item must exist in the player inventory when the GrantCharacterToUser API call is made.

The CharacterType gets set using the ItemId from the item in the catalog. So, in our example, those characters would have been created from an inventory item instance which was of ItemId "blue_warrior".

Brendan

10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

manolhsplaths46 avatar image
manolhsplaths46 answered

hey brendan can you write some code on how to reference this in unity?

like if i wanted to display StatValue, or displayName, how would i do it?

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.

brendan avatar image brendan commented ·

There's a complete example of using many of the basic PlayFab features in our GitHub, here: https://github.com/PlayFab/UnicornBattle. Specific to leaderboards, have a look at the LeaderboardPaneController in that example code.

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.