question

odiakgames avatar image
odiakgames asked

Unreal blueprint leaderboard send score,Unreal blueprints submit leaderboard score

Hi all, I have managed to setup registration / login to playfab through unreal blueprints, but I cannot seem to submit player statistics to the leaderboard I created.

I have (for testing) turned on "Allow client to post player statistics" in the playfab settings. I have run the hello world cloudscript no trouble and it shows on the website that the user logged in successfully.

I Created a leaderboard

and created a blueprint that creates a Json and attempts to update player statisitc "ArcadeScore"

The Request seems to go through ok

LogPlayFab: Request: {

  "Statistics": [
	  {
	  "ArcadeScore": 5000
	  }
  ]
}

But it gets refused with this error

LogPlayFab: Response : 
{"code":400,"status":"BadRequest","error":"InvalidParams","errorCode":1000,"errorMessage":"Invalid
 input parameters","errorDetails":{"Statistics[0].StatisticName":["The 
StatisticName field is required."]}}
LogBlueprintUserMessages: [WBP_StartMEnuv3_C_157] InvalidParams
Invalid input parameters

I am new to this area, but I cant understand where I enter a "StatisticName Field" as asked for by the final error message

Statistics[0].StatisticName: The StatisticName field is required.

Any idea where I have gone wrong?

Thanks

,

Hi, I have managed to setup registration / login to playfab through unreal blueprints, but I cannot seem to submit player statistics to the leaderboard I created.

I have (for testing) turned on "Allow client to post player statistics" in the playfab settings. I have run the hello world cloudscript no trouble and it shows on the website that the user logged in successfully.

I Created a leaderboard

and created a blueprint that creates a Json and attempts to update player statisitc "ArcadeScore"

The Request seems to go through ok

LogPlayFab: Request: {

  "Statistics": [
	  {
	  "ArcadeScore": 5000
	  }
  ]
}

But it gets refused with this error

LogPlayFab: Response : 
{"code":400,"status":"BadRequest","error":"InvalidParams","errorCode":1000,"errorMessage":"Invalid
 input parameters","errorDetails":{"Statistics[0].StatisticName":["The 
StatisticName field is required."]}}
LogBlueprintUserMessages: [WBP_StartMEnuv3_C_157] InvalidParams
Invalid input parameters

I am new to this area, but I cant understand where I enter a "StatisticName Field" as asked for by the final error message

Statistics[0].StatisticName: The StatisticName field is required.

Any idea where I have gone wrong?

Thanks

Leaderboards and Statisticsunreal
playfab.jpg (27.6 KiB)
bp.jpg (128.0 KiB)
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

·
JayZuo avatar image
JayZuo answered

If you check the post sample in UpdatePlayerStatistics, you will see it post a statistic like the following

{
    "StatisticName": "Points",
    "Version": 1,
    "Value": 600
}

And in you code, you are actually generate the "Static JSON" like:

{
    "ArcadeScore": 5000
}

There is no "StatisticName" field in your JSON and that's why you got the error "The StatisticName field is required."

To fix this error, you can change your blueprint like the following to generate the correct StatisticUpdate.


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.

odiakgames avatar image odiakgames commented ·

Thanks for the reply Jay, I had a few misconceptions on how things worked, so thanks for clearing up where I went wrong. For anyone else looking for another anwer, I ended up using cloudscript to handle this by sending the value and then handling updating the score in the cloudscript, I have attached the blueprint of how I sent the score incase anyone is having trouble with this method.

Thanks again JayZuo

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.