Sign In Register

How can we help you today?

Start a new topic
Answered

Collections in GameSparks Properties

Hi.


I want to make configs for my game. And as I read I should use Properties for that.

I've created DefaultMainSquadCharactes property and placed the following JSON as a value:

{ "Characters": [

    { "CharacterName": "Valdes", "CharacterType": "GK" },

    { "CharacterName": "D.Alves", "CharacterType": "RB" },

    { "CharacterName": "Pique", "CharacterType": "CB" },

    { "CharacterName": "Puyol", "CharacterType": "CB" },

    { "CharacterName": "Alba", "CharacterType": "LB" },

    { "CharacterName": "Rakitic", "CharacterType": "RM" },

    { "CharacterName": "Mascherano", "CharacterType": "CM" },

    { "CharacterName": "Iniesta", "CharacterType": "CM" },

    { "CharacterName": "Pedro", "CharacterType": "LM" },

    { "CharacterName": "Messi", "CharacterType": "CF" },

    { "CharacterName": "Neymar", "CharacterType": "CF" },

]}


The error message appeared telling me that this JSON is invalid.

Is that because Properties don't support arrays in JSON?


Then where should I define a collection that's default globally, for every player in the game?

Thanks.


Best Answer

You have an additional comma in the JSON that causes it to be invalid


If you lose the comma after the last Character it will be valid

1 Comment

Answer

You have an additional comma in the JSON that causes it to be invalid


If you lose the comma after the last Character it will be valid

Login to post a comment