question

My Game Studio avatar image
My Game Studio asked

Unreal Blueprint

Hi,

 

I am new to Playfab and have managed to register new players through Unreal (see attached). Can you confirm how I would attach a statistic to the player? A screen shot would be much appreciated.

 

Additionally I have manually added a statistic called “score” through the Playfab website though I am struggling to recall any data through Unreal. Can you identify if I am missing anything from the image attached, the error code I get back is 1074?

many thanks 

 

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

The 1074 error is "NotAuthenticated". All the Client API calls (apart from login and password reset) require that you have a signed-in user. Can you try adding that to your project?

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

Here's the login pattern from the PlayFab Blueprint SDK: https://github.com/PlayFab/UnrealBlueprintSDK/blob/master/Images/01_TestLoginBlueprint.png. We'll see about getting some more examples into that folder as soon as we can.

10 |1200

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

My Game Studio avatar image
My Game Studio answered

Thanks for the quick response, I didn't realise you had to login to retrieve data, I have now got it working.

 

could you offer any advise on how to add a stat to the player? I have only managed to do this from the online portal so far.

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

In general, I'd advise writing statistics from a server-side operation, so that you can have appropriate checks in that logic to prevent cheating - you can use Cloud Script for this. There's a sample script which is already in your title as revision 1, which shows how to make calls to the Server API. The call you want is:

https://api.playfab.com/Documentation/Server/method/UpdatePlayerStatistics

10 |1200

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

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.