Save to disk using node-webkit

Get help using Construct 2

Post » Wed Sep 17, 2014 7:52 pm

Why does it matter?
Scirra Founder
B
385
S
227
G
86
Posts: 24,148
Reputation: 190,849

Post » Wed Sep 17, 2014 8:00 pm

It would matter for things like Steam Cloud, transferring saves easily etc
B
92
S
31
G
24
Posts: 3,191
Reputation: 32,669

Post » Wed Sep 17, 2014 8:01 pm

Personally I'd like the option. From a gamer's point-of-view it's irritating to uninstall a game and then have to go hunting through obscure locations to clean out saved games, caches and other data. Being able to specify (a) "default folder" (b) "app folder" or (c) "My Docs\app name" for local storage would be a neat little feature, if it's not a massive hassle to implement. It'd certainly be a courtesy to players. Not sure how much control over this NW assumes and how much control we have on our side, though.
B
57
S
15
G
11
Posts: 912
Reputation: 12,596

Post » Thu Sep 18, 2014 2:43 am

So im making a platformer editor in which the user can edit and position the objects in the game. Then he can save n distribute the result to others to play. The problem is when it is distributed, the objects will return to the default positions as the save file is not in the app folder but in the OS' appdata folder. Pls help. Thnks
B
54
S
11
G
5
Posts: 101
Reputation: 7,247

Post » Thu Sep 18, 2014 7:03 am

GeometriX wrote:Personally I'd like the option. From a gamer's point-of-view it's irritating to uninstall a game and then have to go hunting through obscure locations to clean out saved games, caches and other data. Being able to specify (a) "default folder" (b) "app folder" or (c) "My Docs\app name" for local storage would be a neat little feature, if it's not a massive hassle to implement. It'd certainly be a courtesy to players. Not sure how much control over this NW assumes and how much control we have on our side, though.


agree, would be great to have it as an option
B
15
S
3
G
3
Posts: 93
Reputation: 1,466

Post » Thu Sep 18, 2014 9:53 pm

If someone wants to have easy portable game if would be nice to have optionally saves at same directory.
B
12
Posts: 9
Reputation: 457

Post » Thu Dec 11, 2014 6:28 am

@Ashley having the saves go to the game's location is very useful, it's the standard practice for games. It means that we don't have to teach our users how to go to: "C:\Users\John\AppData\Local\Roaming\Documents\Programs\Features\Gardening\Knitwear\Publisher\Developer\GameName\Sausages\X34265"
they can just go to the game's folder where saves are usually kept in normal games.

@nothaseo Have you been able to do it yet?
B
140
S
71
G
17
Posts: 1,773
Reputation: 20,511

Post » Thu Dec 11, 2014 2:28 pm

If you want to use build in "save game" you should be able to use Node-Webkit "Write file" on System "On save complete"
Code: Select all
Path = NodeWebkit.AppFolder&"Saved games/"&"Save 1"
Content = SaveStateJSON


Edit:
To load you can use "System Load game from JSON string"
Code: Select all
NodeWebkit.ReadFile(NodeWebkit.AppFolder&"Saved games/"&"Save 1")


Edit 2: Note that the "Saved games" folder needs to exist or you can check if the folder exists and create one if not.

Edit 2134515: Original post was a bit old wasn't it :/
You do not have the required permissions to view the files attached to this post.
B
34
S
9
G
3
Posts: 517
Reputation: 5,206

Post » Thu Dec 11, 2014 3:24 pm

Thanks a lot for this CAPX @Katala, it will be very useful for Steam cloud saving feature : )
Image | @AurelRegard on twitter
B
19
S
6
G
1
Posts: 307
Reputation: 2,500

Previous

Return to How do I....?

Who is online

Users browsing this forum: ColombageEnPLS and 4 guests