Dictionary/Array JSON export without C2 wrapper

Discussion and feedback on Construct 2

Post » Tue Dec 02, 2014 8:07 am

Hi (@Ashley),

I have quite a bit of trouble with moving data via JSON export from Dictionaries and Arrays to other programs. I need to reparse all my structure to generate "genuine" JSON, and am still working on this code and its brittle. Its all lots of recursive structures, five levels down with an element of dynamism (some are four or three levels down, and some are five).

It would be really great, if there was a JSON export geared for interoperability without C2s Dictionary and Array wrappers. This could then be imported straight into other programs -- such as Mathematica (where i want to do all the data visualization).

thanks,

Dan
B
8
S
4
G
1
Posts: 205
Reputation: 1,354

Post » Tue Dec 02, 2014 12:28 pm

Construct 2's dictionary/array formats are not totally interoperable with JSON. For example you cannot have objects or arrays inside dictionary values. This is why C2 uses a variant of the format. It should not be difficult to convert between the two though (no recursion should be necessary!)
Scirra Founder
B
395
S
232
G
88
Posts: 24,368
Reputation: 193,746

Post » Tue Dec 02, 2014 12:31 pm

Thanks.

In the end I (nested) looped (with conditions) through all the dictionary structures and used the JSON plugin to recreate JSON. Took some time to work out.

Would there be value to have a compatible JSON export on dictionaries and arrays?
B
8
S
4
G
1
Posts: 205
Reputation: 1,354


Return to Construct 2 General

Who is online

Users browsing this forum: Rastacity and 4 guests