How to Create Save and Load in CocoonJS ?

Get help using Construct 2

Post » Sun Oct 07, 2012 8:01 am

How to Create Save and Load in CocoonJS ? (CocoonJS Doesn't support WebStorage plugin's !)

Thanks
B
21
S
6
G
5
Posts: 57
Reputation: 4,954

Post » Fri Oct 12, 2012 7:45 am

Bump, since I was wondering the same (and still am!) ;)
Image Image Image
B
82
S
21
G
8
Posts: 163
Reputation: 11,516

Post » Fri Oct 12, 2012 7:53 am

CocoonJS still supports Local Storage, but doesn't session.
B
96
S
25
G
20
Posts: 3,054
Reputation: 22,642

Post » Fri Oct 12, 2012 8:18 am

Somehow, I got cocconJS to work with webstorage. I saved some data, closed the app, came back to the app, and it worked fine.

Edit: I just read the CocoonJS tutorial, to check on the limitations.
@Joannesalfa is correct, You can easily overcome this by using global variables. Local storage is (some what) permanent save, where as session is for that session only (much like the incognito mode in most browsers).lonehangman2012-10-12 08:23:36
B
18
S
9
G
5
Posts: 77
Reputation: 4,946

Post » Fri Oct 12, 2012 1:52 pm

> CocoonJS still supports Local Storage, but doesn't session.

That was what I was thinking too but when I launched my game on ios using webstorage for saving high score data between games, I got the black screen. I removed webstorage and the game runs properly...    roberto2012-10-12 14:17:27
Image Image Image
B
82
S
21
G
8
Posts: 163
Reputation: 11,516

Post » Fri Oct 12, 2012 2:00 pm

Global variables don't persist between sessions - you shouldn't rely on them because even if you close and reopen and they're still there, there's a chance the OS could kill the app which will reset all the variables. Also the phone restarting will wipe global variables again.

Just use WebStorage - writing to local storage will save data permanently.
Scirra Founder
B
359
S
214
G
72
Posts: 22,952
Reputation: 178,580

Post » Fri Oct 12, 2012 4:12 pm

Ok, now webstorage works fine! I wonder what was wrong earlier...
Image Image Image
B
82
S
21
G
8
Posts: 163
Reputation: 11,516

Post » Sun Oct 14, 2012 10:31 am

@Ashley

I meant to over come session limitations. Just wanted to clear it up so I don't look silly in front of the great C2 developer ;D
B
18
S
9
G
5
Posts: 77
Reputation: 4,946

Post » Wed Apr 24, 2013 4:47 am

@Ashley @Ludei

I love the new Load/Save system that you guys introduced recently. It does exactly what I need. I notice that it doesn't work with CocoonJS unfortunately. Are there any plans to get this working? This would be amazing! I am working on a game for Ouya / Android Phones, and a save system is very important. With this and some support for Ouya controllers (from Ludei) and I will be set! :) Thanks for any info!
B
8
S
2
G
4
Posts: 64
Reputation: 3,199

Post » Wed Apr 24, 2013 8:43 am

WebStorage doesn't safely.
Your game data may be cleared five days later, may be ten days...
And it is depressing me.
B
55
S
19
G
8
Posts: 191
Reputation: 8,831

Next

Return to How do I....?

Who is online

Users browsing this forum: Yahoo [Bot] and 7 guests