I'm trying to learn how to use Json but I can't figure it out.
I created an event where I record an object (bgobject) and its parameters in a .json file.
And then I want to load the layout with json creating all the objects in their position and its parameters.
But I can't find the contents of the arrays.
I also found an old discussion in the forum but I still can't continue.
--> https://www.construct.net/en/forum/construct-3/how-do-i-8/valuesjson-array-loop-166959
What should I do?
and is my approach with JSON right?
Develop games in your browser. Powerful, performant & highly capable.
So what JSON string do you see in browser console?
Not sure why you are storing each object as an array. Try this instead:
Use "Set Value" action instead of "Push"
Thank you! now I have to create a function that creates all the objects.
Can you tell me how to do it? With an example? sorry but my brain is on fire, Json I struggle to understand.
Use relative paths like ".keyname" to access values.
Yes! It worked perfectly! And immediate.
I was afraid that since there were almost 100 objects (almost all small stars) there would be some problems but none!
Thank you!