Hi!
I've been learning about implementing JSON in Construct 3. I've read the manual, and done a little study on the wider web, but a few things still aren't clear to me.
1) If I have an array in JSON which is, in turn, comprised of multiple key:attribute pairs, is there a way to use a given attribute to call for attributes of other keys within the same element of the array? For example, let's my JSON describes the parameters for a bunch of skills that the player can use. It looks something like:
{
"Skills": [
{
"Name":"Punch",
"baseDamage":1
},
{
"Name":"Kick",
"baseDamage":2
}
]
}
How do I tell Construct that when the player selects the skill named "Punch", it should use 1 in subsequent damage calculations, vs. 2 when the Skill is named "Kick"?
2)What is the most efficient way to incorporate data from different JSON files into the same project? For example, skill data (names, damage, etc.) vs. enemy data (HP, attacks, etc.). I've seen an example where, I think, someone shifted AJAX.LastData to an array object as part of setup, then used AJAX to request the second JSON file, and parsed that with the JSON object. But I'm not sure whether that's the best way, or if I'm even understanding that process correctly.
3) Related to Question 2, is there a way to make multiple JSON files talk to each other? So if data pulled from one JSON fulfills certain conditions, data in another file is altered?
Thanks in advance for any help. Let me know if I can supply more information to aid in your response(s).