Hi Folks,
Maybe a basic question, but i turn around since few days
I’m trying to make the following things through GUI:
-I’m get a JSON from URL
-Store it in a VariableString
-Decod it in a GlobalVariableString
-Make a loop with integer number and use it in the GlobalVariableString syntax
Exemple:
A JSON like this:
[{
"count":
{
"counter": "39"
},
"1":
{
"x": "100",
"y": "120"
},
"2":
{
"x": "250",
"y": "251"
},
"3":
{
"x": "68",
"y": "49"
},
...
VariableString: OK by using GET
Get the counter value OK: counttarget = ToNumber(GlobalVariableString(myjsonp.0.count.counter))
Define a count variable = 0
“But, here is my issue”:
GlobalVariableString(myjsonp.0.1.x) OK, it work like this (here result is “100”)
I’m trying to create a loop like:
while counttarget < count then:
GlobalVariableString(myjsonp.0.GlobalVariable(count).x)
Add 1 to count
Unfortunately, i get an error message in GUI, and it seems to not work.
I was able to do it following this method in Construct, maybe i can do it differently with Gdevelop?
Thanks a lot for your help!