question

Tibor Dandi avatar image
Tibor Dandi asked

Get Character ID in unreal engine 4

Hi there,

I just followed this instructions but i could only get the character name!

https://docs.microsoft.com/en-us/rest/api/playfab/server/characters/getalluserscharacters?view=playfab-rest

Can you explain me how to get the CharacterId? because It request for updating its Data,Statistic and such things!

Target is server.

Thanks your help!



unrealCharacter DataCharacters
uw0ls.png (480.8 KiB)
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.

Tibor Dandi avatar image Tibor Dandi commented ·

It prints me "0" for Character name and type in the results.

0 Likes 0 ·
Seth Du avatar image
Seth Du answered

I have tried to reproduce this issue but my blueprint works fine. It should be very similar to yours. Would you check the nodes again?

The log outputs seems to be correct:

LogBlueprintUserMessages:[Test_C_1] FighterDude-- 3D8620DCD494E693--Blue Warrior
LogBlueprintUserMessages:[Test_C_1] FighterDude2-- B1535F8763931012--AAAAAA
LogBlueprintUserMessages:[Test_C_1] FighterDude2-- D784CA9010147E47—AAAAAA


10 |1200

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

Tibor Dandi avatar image
Tibor Dandi answered

hey

Well mine shows : 0

For I'd and type .

Could you show me your whole blueprint parts please ? (Get all user character )

I use server version .

Thanks

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.

Seth Du avatar image Seth Du ♦ commented ·

Sure. Please check Get Character Test > BlueprintUE.com | PasteBin For Unreal Engine 4. I have changed to Server API.

Meanwhile, even though we don't add any Print node, the PlayFab UE4 SDK will generate the full callback content in the log, which will be like:

LogPlayFab: Response : {"code":200,"status":"OK","data":{"Characters":[{"CharacterId":"3D8620DCD494E693","CharacterName":"FighterDude","CharacterType":"Blue Warrior"},{"CharacterId":"B1535F8763931012","CharacterName":"FighterDude2","CharacterType":"AAAAAA"},{"CharacterId":"D784CA9010147E47","CharacterName":"FighterDude2","CharacterType":"AAAAAA"}]}}<br>

Please double-check that you can see this log and make sure the player has the characters.

0 Likes 0 ·
Tibor Dandi avatar image
Tibor Dandi answered

hey thanks i was using "number fields" instead "string fields" now its ok!

thanky!!


Also can you tell me why the error says:
"Kills" is not a valid statistic name?
What is the good way to set the statistic name and the value what I want to update for the selected character?

thanks!


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.

Seth Du avatar image Seth Du ♦ commented ·

"Kills" should work fine, and there is no straightforward invalid name for statistics. Any returned error messages for my reference?

0 Likes 0 ·
Tibor Dandi avatar image
Tibor Dandi answered

this is how i set the updating json:

here is the error at the end:


1.png (504.4 KiB)
2.png (454.0 KiB)
3 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.

Tibor Dandi avatar image Tibor Dandi Seth Du ♦ commented ·

well i would like to update the Character statistic and not player statistic, as you can see i used :

https://docs.microsoft.com/en-us/rest/api/playfab/server/characters/updatecharacterstatistics?view=playfab-rest

And the character is already exist and having the Kills statistic what i added when i grantet the character at "add title data"

0 Likes 0 ·
Seth Du avatar image Seth Du ♦ Tibor Dandi commented ·

Please refer to Server update Character Sta > BlueprintUE.com | PasteBin For Unreal Engine 4.

The corresponding error means the request is not defined properly. The best way to debugging this issue is to check the official documentation and understand the types that defined in request node by SDK. Update Character Statistics API is using an Object instead of an array, hence you will need to construct an Object, which contains KVPs (also in the form of PlayFab JSON Object).

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.