Export Array Data?

Get help using Construct 2

Post » Mon Jul 01, 2013 9:43 pm

Is it possible to export array data into a text file or something?

I have a very large array that I would like to be able to reload every time the app is restarted as well as back up in case something changes or the project itself morphs into something else I still have the data the array collected over time. WebStorage doesn't seem like the appropriate solution...

This is a very closed project, no internet, no online, no public distribution, it is a private one time use only.
B
10
S
4
G
2
Posts: 133
Reputation: 2,667

Post » Mon Jul 01, 2013 10:52 pm

You can get the array JSON structure with the *Array-Name*.AsJson

and you can load an array using LOAD in the array's actions section ...

Cheers and have fun debugging JSON codes ;) !
B
41
S
17
G
17
Posts: 2,247
Reputation: 17,436

Post » Tue Jul 02, 2013 6:21 am

You can do this without using Webstorage? Where is the JSON written so I can look at it outside the app? I've been using Webstorage to save the array between sessions but I haven't been able to find where its stored...

I am slightly confused now because I thought you had to use Webstorage or an AJAX/PHP call to write files and save stuff. If I can write a JSON file directly to a local file without WebStorage and access that file outside my app then I will at least have the array.AsJSON that I can work with. Its better than nothing!

I just found the CSV plugin from rexrainbow... I think this will give me the tools I am looking for although I have not attempted to use it yet.

Thanks for the reply!
B
10
S
4
G
2
Posts: 133
Reputation: 2,667

Post » Tue Jul 02, 2013 7:27 am

I can't find anything in the manual or tutorials on how or where the arrayName.Asjson is saved.

Saving the array so I can access the data later is really the most important part...
B
10
S
4
G
2
Posts: 133
Reputation: 2,667

Post » Tue Jul 02, 2013 10:34 am

B
14
S
5
G
4
Posts: 107
Reputation: 4,788


Return to How do I....?

Who is online

Users browsing this forum: kiugetski and 13 guests