Save to disk using node-webkit

Get help using Construct 2

Post » Sat Mar 30, 2013 6:29 pm

Hey there guys,

I would like to ask you if there is any way to make Save/Load system for game that is not even meant to be played in a browser. I only plan to export it using node-webkit and I can't seem to find a way to save game state to hdd.
Any help is appreciated.

Thanks,
Elci
B
4
Posts: 6
Reputation: 462

Post » Sat Mar 30, 2013 6:56 pm

Webstorage should do the trick:

[quote=Manual]Note that despite the name the WebStorage object does not use online storage. Since data is stored locally to the user's computer, it will work when offline, as well as for storing data like save games in offline exporters such as node-webkit.[/quote]
B
27
S
8
G
8
Posts: 903
Reputation: 8,452

Post » Sat Mar 30, 2013 7:05 pm

Wow, thanks a lot, I certainly did not know that webstorage would work even when exported. I've read somewhere that using software like ccleaner would clear saved webstorage.

Btw how hard is it to store large amounts of data (multiple large arrays etc.) with webstorage?
B
4
Posts: 6
Reputation: 462

Post » Sat Mar 30, 2013 7:13 pm

If you clear your cache or use CCleaner you will clear webstorage, yes. I'm not sure how it works with node-webkit. I haven't really used webstorage that much, but you could always just make a simple test youself.

I'd say storing large amounts of data is relatively simple since you can use JSON for arrays, dictionaries (hash-table) and webstorage. I would have a look in the manual for more information on those subjects.
B
27
S
8
G
8
Posts: 903
Reputation: 8,452

Post » Sat Mar 30, 2013 9:15 pm

Under Windows, node-webkit exported games store their webstorage info at "OS:\Users\Username\AppData\Local\AppName\Local Storage", which is unaffected by users clearing their web browser's cache.

I've tested CCleaner and it also leaves the data alone. Other cleanup applications might be more brutal, but I guess you could be extra careful and warn players against running these sorts of applications.
B
56
S
15
G
10
Posts: 910
Reputation: 11,942

Post » Sat Mar 30, 2013 9:31 pm

@GeometriX:
That's good to know, thanks for clearing that up.
B
27
S
8
G
8
Posts: 903
Reputation: 8,452

Post » Sun Aug 10, 2014 9:14 pm

GeometriX wrote:Under Windows, node-webkit exported games store their webstorage info at "OS:\Users\Username\AppData\Local\AppName\Local Storage", which is unaffected by users clearing their web browser's cache.
Do you have paths for other operating systems? Linux and MacOS

GeometriX wrote:I've tested CCleaner and it also leaves the data alone. Other cleanup applications might be more brutal, but I guess you could be extra careful and warn players against running these sorts of applications.
Actually it would be bit dangerous to clear random \AppData\Local\ directories. It could reset many apps to defaults and revoke licenses. Surely dirs could be scanned for known info but I don't think any cleaner will do that. Slow and not foolproof.
B
12
Posts: 9
Reputation: 457

Post » Mon Aug 11, 2014 2:16 pm

The built-in savegame system still works in node-webkit.
Scirra Founder
B
359
S
214
G
72
Posts: 22,946
Reputation: 178,478

Post » Wed Sep 17, 2014 7:24 pm

Is there a way to make the save data in app folder when we export using node-webkit @GeometriX , @Nimtrix , @JoKiv, @Ashley?
not in OS:\Users\Username\AppData\Local\AppName\Local Storage

Thanks
B
41
S
9
G
4
Posts: 100
Reputation: 6,211

Post » Wed Sep 17, 2014 7:52 pm

Why does it matter?
Scirra Founder
B
359
S
214
G
72
Posts: 22,946
Reputation: 178,478

Next

Return to How do I....?

Who is online

Users browsing this forum: No registered users and 15 guests