Cant Load Array JSON directly (need help)

0 favourites
  • 2 posts
From the Asset Store
Game with complete Source-Code (Construct 3 / .c3p) + HTML5 Exported.
  • hi. what im trying to do is to load an array JSON (previously retrieved from a textbox by copying) using the "load" action, but whenever i paste my entire JSON text file there it wont allow me because of a syntax error with the double brackets "" even while putting it in another set of brackets it wont let me. is there something with the "" that wont allow it to be used in a text string?

    just loading the JSON from a variable is fine but i previously constructed the JSON using an editor and just want to copy paste the JSON in there load action but it wont allow me. the only place where the "" rules dont apply is when setting a text variable to the JSON and then loading the array from that but its not very practical having to create another variable for each JSON string. need some help if this is possible.

    for example just try loading a JSON with the "load" action from an array with this string:

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

    and you notice it wont let you because of the "" brackets between c2array, size and data.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • If you want to put JSON string directly into the Load action, it needs to be in quotation marks, and all " inside it should be doubled.

    Try this:

    "{""c2array"":true,""size"":[1,1,1],""data"":[[[0]]]}"
    [/code:1sp0ubye]
Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)