Hi Guys,
I know how to grant a character with the cloudscript...how do I get the character Id...I tried using the client there was an error in the process. This will really help me..thank you!
Hi Guys,
I know how to grant a character with the cloudscript...how do I get the character Id...I tried using the client there was an error in the process. This will really help me..thank you!
You can use Client API GetAllUsersCharacters or Server API GetAllUsersCharacters to get a specific player’s all characters’ CharacterId. Server API and Client API of GetAllUsersCharacters can both access all player’s CharacterId, CharacterName, CharacterType. Please refer to the following CloudScript code to get character Id from the server.
handlers.getUsersCharacters = function (args, context) { var request = { //You can modify the PlayFabId to any player’s one. PlayFabId: currentPlayerId, }; var getUsersCharacters = server.GetAllUsersCharacters(request); return {Characters:getUsersCharacters}; };<br>
There's what I want to do...I want to get the ID value in the server, and use that to
update, delete, or read the character.......I saw this, and its a perfect example of getting a data
but this one is a key, characterID is not a key. How do I get it still...I know the return method returns a the args...but can you explain this to me in a simplier term
//make an api call to the server for a string var
playerData = server.GetUserInternalData({ PlayFabId: currentPlayerId, Keys: ["last_move_timestamp"] });
//put the string into a variable var lastMoveTimestampSetting = playerData.Data["last_move_timestamp"];
You can refer to the following code.
handlers.getUsersCharacters = function (args, context) { var request = { PlayFabId: currentPlayerId, }; var getUsersCharacters = server.GetAllUsersCharacters(request); var characterId = getUsersCharacters.Characters[0].CharacterId; return { CharacterId: characterId }; };
Thanks for helping me...I think I will just ignore this part of playfab.
3 People are following this question.