(Solved) Populate array by loading JSON string directly?

  • 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)

    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?

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • 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

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)