question

David Jones avatar image
David Jones asked

Title Data JSON help

I'm new to creating my own JSON files so I don't really know the syntax, i tried to copy an example however the title data wont accept my syntax for this file. Can someone please tell me what's wrong with it

{
  "SocialClasses": [
    {
      "SocialClass":Settler,
	  "Rating":0
    },
    {
      "SocialClass":Vigilante,
	  "Rating":50
    }]

}
Title Data
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

·
Seth Du avatar image
Seth Du answered

I am not sure which platform/ Engine you are using, but from the code you provide, it should be:

{
    "SocialClasses": [
      {
        "SocialClass":"Settler",
        "Rating":0
      },
      {
        "SocialClass":"Vigilante",
        "Rating":50
      }]
}


8 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.

David Jones avatar image David Jones commented ·

Even the syntax you provided doesn't work, im just trying to upload some title data. Is there an easier way?

0 Likes 0 ·
Seth Du avatar image Seth Du ♦ David Jones commented ·

May I ask how do you upload data, are you using Game Manager or API call? if it is API call, what language or SDK version are you using? I can directly write an example for you.

0 Likes 0 ·
David Jones avatar image David Jones commented ·

I’m trying to upload it in the game manager with the “upload Json” button on the title data tab

0 Likes 0 ·
David Jones avatar image David Jones commented ·

Basically just trying to create a system to give a “social class” to players that have the rating required for it. Am I right in thinking title data would be best for that? Or should I make the system on the client/unity?

0 Likes 0 ·
Seth Du avatar image Seth Du ♦ David Jones commented ·

First of all, if you are trying to upload a json file to the Title data, you should note the format carefully, I will dump a JSON file of title data from PlayFab Official demo Unicorn Battle. Please see the attachment. title-data.zip

Be aware that the value field in the title data can only be string if you are directly sending Http request (including using RESTful API testing tools like Postman), so that you need escape the quote marks.

Title data is a cached and sharded resources which means it is not designed for frequent changes. It will be fine if the SocialClasses is a data that should be shared with all players and doesn’t change frequently.

1 Like 1 ·
title-data.zip (5.1 KiB)
Seth Du avatar image Seth Du ♦ David Jones commented ·

In addition, here is a screenshot of my Title data web page:

0 Likes 0 ·
David Jones avatar image David Jones Seth Du ♦ commented ·

Thank you so much, I finally got it to upload. My thought process was to upload the "socialclass" definitions into titledata, and then whenever their "rating" got to the threshold to enter a new social class then it would award the player via cloudscript with the different kind of rewards. Does that make sense?

0 Likes 0 ·
Show more comments

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.