(Solved) Populate array by loading JSON string directly?

Get help using Construct 2

Post » Thu Mar 30, 2017 9:23 pm

Guys, I thought I could just load in the JSON text generated from a different array into another no?

eg I have a load of curve points here generated in JSON from a previous array

trying to load it to this array on start up (Load from JSON string)

Image

but is doesn't like the formatting.

Ive put it in quotes , taken out the first section just leaving the bracketed stuff

but it dosent like anything.

Is it possible to do this directly like this without having to reference a text file or such?
Last edited by NetOne on Fri Mar 31, 2017 10:21 am, edited 1 time in total.
...
B
45
S
23
G
7
Posts: 291
Reputation: 8,020

Post » Thu Mar 30, 2017 9:48 pm

Ok perusing some non related stuff I found the answer, its probably well known by the pros but for the noobs...

the quirky thing is that all text strings within the JSON array file have to be in double quotes.

so I just did a find and replace on the quotes and all works OK.

(And the string itself has to be in single quotes)

eg

Image
...
B
45
S
23
G
7
Posts: 291
Reputation: 8,020


Return to How do I....?

Who is online

Users browsing this forum: No registered users and 32 guests