How to use a var "in" a var with GUI syntaxe?

Hi Folks,

Maybe a basic question, but i turn around since few days :smiley:

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

A JSON like this:

   "counter": "39"
   "x": "100",
   "y": "120"
   "x": "250",
   "y": "251"
   "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:
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!

I’m talking from my memory here
I think you have to split the string using another helper variable
(Scene Variable) temp_string = myjonp.0. + GlobalVariable(count) + .x

Thx for your answer.

I found a way, i put it here if it can help. The main topic is to understand the variable and child concept (i was not ^^). We can put as var Child, while we can’t with variable itself. The doc on wiki explain it, but was hard to understand on my side.


Work like a charm :slight_smile: