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
359
S
214
G
72
Posts: 22,952
Reputation: 178,580

Post » Wed Sep 17, 2014 8:00 pm

It would matter for things like Steam Cloud, transferring saves easily etc
B
90
S
30
G
24
Posts: 3,189
Reputation: 32,400

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
56
S
15
G
10
Posts: 910
Reputation: 11,952

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
41
S
9
G
4
Posts: 100
Reputation: 6,211

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
14
S
3
G
3
Posts: 93
Reputation: 1,441

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
134
S
65
G
16
Posts: 1,766
Reputation: 19,190

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
31
S
8
G
3
Posts: 517
Reputation: 5,011

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,495

Previous

Return to How do I....?

Who is online

Users browsing this forum: fredriksthlm, MPPlantOfficial, Yahoo [Bot] and 19 guests