question

Riccardo Iengo avatar image
Riccardo Iengo asked

How to get user profile from GetLeaderboardAroundUser?

Hi!

I'm working on a racing videogame and I need to load three ghosts player(associated to a user who previously set a record) on race start. As many racing videogames I want to load three ghosts around the user.

For example If I join the race and according to the Leaderboard my position it's n.22 I would like to load the ghosts n. 20, 23 and 25.
I don't really know how it works but I assume that I should first call the User Profile that I want to load and then its relative PlayerData which is the replay stored.

How can I do this? Should I create some custom Cloud script for this? If yes, how?

I hope my question it's clear!

Thankssss

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

·
Gosen Gao avatar image
Gosen Gao answered

Custom data won’t show in the Player Profile. According to your description, I assume you store the record in PlayerData(Title)-ReadOnlyData. You can call GetUserReadOnlyData with the PlayFabIds get from the result of GetLeaderboardAroundUser to get the record.

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

Riccardo Iengo avatar image Riccardo Iengo commented ·

I tried to call 4 users and it shows me the three users which are higher in the leaderboards according to my position of course. But for example if I'm number 19 in the leaderboard, how can I call specific users? Like I want to call user n. 17, 21 and 22? Is there a way to accomplish this?

0 Likes 0 ·
Gosen Gao avatar image Gosen Gao Riccardo Iengo commented ·

GetLeaderboardAroundUser has a parameter name “MaxResultsCount” which decides how many entries will return. If that parameter is set to 3, it will return 1 player higher than you and 1 player lower than you and yourself.

In your scenario, setting “MaxResultsCount” to 7 should be alright.

1 Like 1 ·

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.