How do I save an entire array onto a variable

Get help using Construct 2

Post » Sun Feb 08, 2015 8:48 am

I have a long array, 120 x cells long. How do I save all of it at once into a variable?

All this while I have been using short arrays, less than 10 and saving them into a variable using the (array.At(0)&","&array.At(1)......etc etc). But since I have 120 cells long what would be a more efficient way to save the new array to a variable?

Thanks guys.
B
41
S
20
G
31
Posts: 684
Reputation: 20,189

Post » Sun Feb 08, 2015 8:57 am

See https://www.scirra.com/manual/108/array

Download
Invokes a browser download of a file containing the Array's contents in JSON format. This is intended for offline development, e.g. creating level editors.

Load
Load the contents of the array from a string in JSON format. This must have been retrieved from either theDownload action or the AsJSON expression. It could also be retrieved dynamically from the AJAX object.


Does this answer your question?
I got a game that you multiply, breath fire with two heads and brawl foes to oblivion with your clones: http://www.newgrounds.com/portal/view/660664 (use Chrome on Windows for best performance)

My sites:
http://twinblazar.deviantart.com
http://twinblazar.newgrounds.com
https://twitter.com/twinblazar
http://www.pixiv.net/member.php?id=15072448
B
30
S
11
G
11
Posts: 411
Reputation: 8,459

Post » Sun Feb 08, 2015 9:34 am

Thanks @keroberos. Will look into JSON as this will be the first time working with it. All my previous was with webstorage and I had to manually enter one after the other.
Again, thanks!
B
41
S
20
G
31
Posts: 684
Reputation: 20,189


Return to How do I....?

Who is online

Users browsing this forum: plinkie, Yahoo [Bot] and 2 guests