Access variable value in JSON? [SOLVED].

Get help using Construct 2

Post » Sun Jun 25, 2017 8:57 am

EDIT
Ok, I'll use a row in an array to indicate the type of object to create.
So:

Column 0 object type
Column 1 object state in JSON


---------------------------------------------

Hello, I have saved the state of an object in JSON, now I want to query the value of a variable in the JSON string.

How do I query the value of a variable in a JSON string?

I need to create objects from JSON strings, so to know which object I have to create from a string, I need to query the value of an object variable that indicates what kind of object it is.
I have seen that C2 does not save the object type when using "AsJSON".
It only saves the state of the object but does not indicate what kind of object it is.
At least it does not in a text variable that indicates the name of the type of object as "Tilemap" or "Sprite"

Here you can see that there is no variable with the name of the type of the object.
Image


So if I give you that information in JSON and I say "you must create an object in that state", you will not know what kind of object you should create.
So my question, I need to query the value of an object variable that I will use to indicate the type of object that I must create from a JSON string.
B
31
S
13
G
21
Posts: 844
Reputation: 14,693

Return to How do I....?

Who is online

Users browsing this forum: Yahoo [Bot] and 7 guests