I'm trying to fill an array with some data from a JSON string.
I tread this tutorial and I'm trying to do somewhat the same thing : https://www.scirra.com/tutorials/978/ex ... -game-card
Is is the best way to return data from a JSON string ?
Is there any nicer way to parse the JSON string which would allow us to use string keys instead of numerical indexes that doesn't have any descriptive information ?
Based on what I saw on the tutorial, here is the JSON string I'm loading into an array :
"data": ["5","Conno d'Argos","0","Vela ledit cresdit."]
I'd rather have for example a js object like this :
"points" : "5",
"name" : "Conno d'Argos",
"cost" : 0,
"description" : "Vela ledit cresdit."
That I could parse and populate my Construct 2 project objects using these descriptive keys. Is it possible ?
And another question :
Here is the array filled with the Load from JSON event from my JSON string (the first one) :
Array data :
0 : 5
1 : C
2 : 0
3 : V
It takes only the first character of each array element, do you know why ?