question

Jeff Gennusa avatar image
Jeff Gennusa asked

Please post an example for uploading character data

Hello, I have this code, which works fine and inputs one piece of character data.

How do I change it to put in more pieces of data? (please just show it as if I'm also adding Age and CharacterName)

Also, is there a limit to the number of data items?

Thank you very much

handlers.UpdateCharacter = function (args, context)
{
    var CharacterId = args.CharacterId;
    var charRecipe = args.recipe;
    
// store info to character account var UpdateCharacterDataRequest = { // key can be called anything you want PlayFabId: currentPlayerId, CharacterId: CharacterId, Data: { "CharacterRecipe": charRecipe } }; // send the above info to the server var UpdateCharacterDataResult = server.UpdateCharacterData(UpdateCharacterDataRequest); }
CloudScriptCharacter DataCharacters
10 |1200

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

Jeff Gennusa avatar image
Jeff Gennusa answered

Nevermind. I was doing it correctly, but it seems that we can only save about 10 pieces of data in character data. It would be nice, if on the character data screen, it said there was a limit of 10 entries. Also, it would be nice if, once you get to 10 entries, it would not show a new field, as if we can add more. (If I'm wrong about the 10 entries, please explain this to me, because I have tested this with about 15 different revisions and it works when I have 10 or less, but once I try to use 11 or more, it fails) Here is the code, in case someone else has this problem.

handlers.UpdateCharacter = function (args, context)
{
    var CharacterId = args.CharacterId;
    var charRecipe = args.recipe;
    // store info to character account
    var UpdateCharacterDataRequest =
    {
        // key can be called anything you want
        PlayFabId: currentPlayerId,
        CharacterId: CharacterId,
        Data: { 
            "CharacterRecipe": charRecipe, "Hand": args.handVal, 
            "age": args.age, "name": args.name, "time": args.Time
        }
    };
    
    // send the above info to the server
    var UpdateCharacterDataResult = server.UpdateCharacterData(UpdateCharacterDataRequest);
}
10 |1200

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

Jeff Gennusa avatar image
Jeff Gennusa answered

Great. I just got an email telling me I exceeded the limit of 10 (21 hours after I first attempted it).

Look, knowing that I'm only able to use 10 is something which comes with time and experience. Now that I've exceeded it and figured out why, I know what's going on. So I have to find a workaround.

But please, I beg you, PlayFab people. Please put these limits on the actual page where the information is being displayed. Yes, I should probably read through the thousands of pages of documentation, but realistically, that's never going to happen.

I understand this sounds like I'm whining, but I'm not. I know this is my responsibility to know these things. I'm simply asking for you to make it easier for people like me, who don't read through every word of the documentation before starting to use the product (because frankly, I wouldn't understand what it meant anyway, until I started using it and came across a problem with it).

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.

Sarah Zhang avatar image Sarah Zhang commented ·

Please navigate to this page -- https://developer.playfab.com/en-US/[YourTitleId]/limits (replace the [YourTitleId] with your actual titleId) to check the limits for your title. You can find the number limit for Character data updates per request under the title Data Storage.

0 Likes 0 ·
Sarah Zhang avatar image Sarah Zhang Sarah Zhang commented ·

You can also navigate to GameManger->Title settings->Limits to find the limits page for your title.

0 Likes 0 ·
Jeff Gennusa avatar image Jeff Gennusa Sarah Zhang commented ·

Yes, I've read that page a few times. I just don't understand what every one of those things are yet.

It would be nice if there was a line of text on the character data screen which says, "Character data is limited to 10 entries".

1 Like 1 ·

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.