question

jacob avatar image
jacob asked

Using GetPlayerStatistics, I recieve ErrorCode=1135: CharacterNotFound

Hello,

I am using the Playfab SDK plugin for UE4 blueprints. When I attempt to call "GetPlayerStatistics" I am only able to provide StatisticNames and StatisticNameVersions. I assumed I could simply put in one StatisticName into the StatisticNames string param and gather that statistic's value from the player, but I am running into an Error, where it appears the code is attempting to access the playfab's character, but all my statistics are stored on the player -> I never even create a playfab character. I am able to get these statistics that I want from Get Leaderboard, but I only need the current player and not everyone who holds this statistic. Any thoughts?

Error:

LogBlueprintUserMessages: [PlayFabManager_C_0] PlayFab ErrorCode=1135 ErrorName=CharacterNotFound ErrorMessage=A character does not exist with the specified ID ErrorDetails= ErrorText=CharacterNotFound

Thanks,

Jacob

sdks
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

·
brendan avatar image
brendan answered

Correct - StatisticNames and StatisticNameVersions are the only parameters on the GetPlayerStatistics call (https://api.playfab.com/documentation/client/method/GetPlayerStatistics). The only way the CharacterNotFound error can occur is via one of the API calls that is Character-specific, like GetCharacterStatistics. Can you double-check the call that's being made? If you can get a Wireshark capture showing the behavior you're seeing, that would be best.

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

jacob avatar image jacob commented ·

Hey Brendan,

Thanks for always being so responsive! I was never able to get the statistics I needed by providing a StatisticNames param, as the function always was requiring the array param too (StatisticNameVersions). I ended up not putting a result into the GetPlayerStatistics function and it gave me all the statistics of which I am able to parse based off their name.

0 Likes 0 ·
brendan avatar image brendan jacob commented ·

How were you passing in the StatisticNames array? It doesn't take both - it just gets the most recent version.

0 Likes 0 ·
jacob avatar image jacob brendan commented ·

To make the array, I need to construct a new JSON object. When I do that and try to pass it in to the StatisticNamesVersions array, I get an error on the response that says I need to supply the Statistic Name: "PlayFab ErrorCode=1000 ErrorName=InvalidParams ErrorMessage=Invalid input parameters ErrorDetails=StatisticNameVersions[0].StatisticName: The StatisticName field is required.".

If I provide the JSON object I am passing into the array with "StatisticName" in the Field Name of the Set String Field function and the actual statname I am trying to retrieve in the String Value, I get another error: "PlayFab ErrorCode=1000 ErrorName=InvalidParams ErrorMessage=Invalid input parameters ErrorDetails=StatisticNameVersions[0].Version: The Version field is required. ErrorText=InvalidParams".

If I do the same thing with the Version field provided (except using a Set Number Field), it does work now, so that's great news, but the problem I was having was that unlike the GetLeaderboard function, when I try to decode the Response data from GetPlayerStatistics' Response I get no data -> it is instead delivered through the custom event Success which I was not expecting.

0 Likes 0 ·
Show more comments
jacob avatar image jacob commented ·

The Response I am referring to is on the GetPlayerStatistics node, it has a Response that you can break off it but it does not contain any of the Statistics Data. Instead, I have to get the Statistics Data from the Response on the Custom Event (Success). I'm simply suggesting that both of these Responses should deliver the data.

0 Likes 0 ·
brendan avatar image brendan jacob commented ·

Sorry, still not following you. The response to any call to GetPlayerStatistics returns those statistic values, if any valid stats have been specified. Can you please provide the code snippets showing your calls, and the details of the parameters you are passing into the call, so that we can determine what it is you're seeing?

0 Likes 0 ·
jacob avatar image jacob commented ·

As you can see in this image, the two nodes that are highlighted with breakpoints (Custom Event "RecievedAllStatistics" and "DecodeGetPlayerStatisticsResultResponse") are the nodes I am refering to. If you decode the response data from the GetPlayerStatistics, you will not receive any of the data, whereas if you break the result data from the custom event, you will get the proper data.

0 Likes 0 ·
brendan avatar image brendan jacob commented ·

I'm starting to think we're saying the same thing, so it may be that you don't need any additional help with this, but just in case: The results from the GetPlayerStatistics call is an array. I'm not sure how you're attempting to read the response data in your ReceivedAllStatistics node, but by passing the result data it has been sent to a Break, you're specifically extracting the Statistics array from the results, and passing that to a for loop. So it seems like you have what you need, is that correct?

0 Likes 0 ·
jacob avatar image jacob commented ·

Yes, I was able to figure out that the custom event was where the data was being returned. I just assumed I would be able to retrieve this data from the GetPlayerStatistics' Response like some of the other Get function nodes in Playfab.

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.