Load A Json File With the Auto-Correct function

Get help using Construct 2

Post » Tue Jun 18, 2013 3:56 pm

Hey everyone ,

It seems bizarre , but loading an array doesn't work anymore , or is it my syntax that is the problem (?)

Okay , How to reproduce

I got a JSON code here

{"c2array":true,"size":[5,5,1],"data":[[[0],[0],["Exit"],[0],[0]],[[0],[0],[0],[0],[0]],[[0],[0],[0],[0],[0]],[[0],[0],[0],[0],[0]],[[0],[0],["Exit"],[0],[0]]]}

I click on load ;

I insert the code like this

"{"c2array":true,"size":[5,5,1],"data":[[[0],[0],["Exit"],[0],[0]],[[0],[0],[0],[0],[0]],[[0],[0],[0],[0],[0]],[[0],[0],[0],[0],[0]],[[0],[0],["Exit"],[0],[0]]]}"

but then , C2array is a syntax error

I remove the ""

but then {} are syntax errors

and don't tell me to set the code to a variable , because I got 50 other codes to load ...

Thanks for help
B
42
S
17
G
17
Posts: 2,247
Reputation: 17,461

Post » Tue Jun 18, 2013 5:27 pm

The Workaround right now should be installing an old version ...

But We should have a function to remove auto-syntax in the future , What do you think of that @Ashley ?

Edit : Nevermind , the project was saved with an new version and won't work with the new ones . Is there an option to remove that or a way to hack the version and remove the Auto-Syntax ? Whiteclaws2013-06-18 17:34:18
B
42
S
17
G
17
Posts: 2,247
Reputation: 17,461

Post » Tue Jun 18, 2013 5:42 pm

You need "" inside a string to indicate a single ". I wouldn't bother doing it that way, just import project files and AJAX request them, and then you never need to bother with these horribly messy expressions.
Scirra Founder
B
395
S
232
G
88
Posts: 24,367
Reputation: 193,744

Post » Tue Jun 18, 2013 5:44 pm

Hmmmm ... Never thinked about it this way

Well , thanks for response !
B
42
S
17
G
17
Posts: 2,247
Reputation: 17,461


Return to How do I....?

Who is online

Users browsing this forum: blackhornet, unxcellent and 9 guests