How to save an Array as Json

0 favourites
  • 4 posts
From the Asset Store
Supports 1D, 2D, 3D arrays. Import and export arrays in JSON format
  • I created a Json(VisualArray), and using AJAX I put it in a real Array, which I use in my game.

    The problem is how to transform this Array back into a Json and save it in the original file.

    I'm using WebView2, so I have access to my JSON file in the www folder. I believe I can do this using FileSystem, but I was not successful.

    Here's what I did, did I miss something?

    Tagged:

  • I'm able to save now, in the example I'm using the Documents folder:

    The problem now became how can I load this saved file into documents..

    I was thinking about a logic to check if the file exists, if it exists it loads it into the Array, if it doesn't exist, it uses AJAX and loads the "Clean Array"

    However, I don't know which expression to use, AJAX would load the latest data, but the filesystem doesn't have that choice.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • I did it, I did it, I feel like Christopher Columbus haha

    the solution:

  • I put the values in the editor, called in json, put it in the array, and used it

    I want to change the value of the json file and save it and import it whenever necessary and use it as my information. files. Below is the storage location, and I want to know if the path setting is different from mine. Where can I save it if I do it like the example?

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