Can't load json string to an array

Get help using Construct 2

Post » Wed Oct 31, 2012 9:24 am

Hello,

why do I get a 0 instead of 1 if I do this:



Trying to reach the element with three coordinates also returns a zero. "Value: " & Levels.At(0,0,0)

If I dump the content of the array, there's a single zero in it - it seems that the load command does not work as i expected and loads only zeros to an array.

Any ideas where do I go wrong?

Thanks!mordskerl2012-10-31 09:25:10
B
6
S
1
Posts: 10
Reputation: 1,114

Post » Wed Oct 31, 2012 2:16 pm

There's a syntax error in your JSON string. You have four ] but only three [ in the part which says {[[[1]]]]}.

You really should avoid manually typing JSON data like this, it's totally unmanageable - try to just export JSON data from existing array objects that have the values you want, and then you'll never get syntax errors (or ridiculously long expressions).
Scirra Founder
B
359
S
214
G
72
Posts: 22,946
Reputation: 178,518


Return to How do I....?

Who is online

Users browsing this forum: blackhornet, Solomon and 27 guests