I’m doing some thing like this
point.x = 12;
pointsStack[0] = point;
alert(pointsStack[0].x)
(sorry for using JS)
I want to do the same thing in GDevelop
So far I done is below but not works
structureProblem.gdg (6.5 KB)
I’m doing some thing like this
point.x = 12;
pointsStack[0] = point;
alert(pointsStack[0].x)
(sorry for using JS)
I want to do the same thing in GDevelop
So far I done is below but not works
structureProblem.gdg (6.5 KB)
Hi,
Between [ and ], GDevelop need strings, not numbers, so its pointsStack[[size=150]"[/size]0[size=150]"[/size]].x
I have updated as per you said but still have problem.
It should print “12” on canvas
can U please edit and upload again the right way
new.gdg (6.5 KB)
1- VariableString(0)… it works only because GD creates automatically a variable called “0” with default value 0, I don’t know if you did it intentionally, but sounds funny and ironic in some way
2- You can’t copy a structure inside other this way, GD warns you about the syntax of the action “Do = point to variable pointsStack[“0”]”…
To copy a structure inside other, I think you could convert the child structure into a JSON string, and then convert the JSON string in a structure inside the new parent variable… Maybe there is a better way
EDIT: Here is a working example:
append_structure.gdg (7.96 KB)