(Saved Data) Save and load on multiple computers?

Get help using Construct 3!

Post » Mon Aug 14, 2017 10:02 pm

Hello,

I am working on an a web app that uses the Save Function. And LocalStorage.

I must be able to share this saved slot. I know LocalStorage uses Json. But I am struggling on figuring out how I can download the saved data, share it, then have another computer load it.

The sad part is, if I cant get this feature I have no choice but to kill the project. So any help will be wonderful.


(Basically, the requirement I have... User must be able to move save slots from computer-to-computer. )
B
14
S
2
Posts: 67
Reputation: 2,044

Post » Fri Aug 18, 2017 3:40 pm

I had a similar issue and was not able to find a reliable method. I ended up going down the route of using the NWJS plugin. I can now save to a specific filetype of my choice, share this and call in and out the data. Downside is that its desktop based and means it can't be used as a web app :(
B
38
S
11
G
1
Posts: 203
Reputation: 4,473

Post » Fri Aug 18, 2017 4:00 pm

Also for Mac. In order for it to work I would need the app to be certified. Or are we able to get around this? As well, are we able to push updates when the user is connected to the internet.

I guess I will get an iOS developer account to code sign the desktop app. 1st time doing that, so time to learn something new.
B
14
S
2
Posts: 67
Reputation: 2,044

Post » Wed Aug 23, 2017 6:14 pm

I'm using this snapcode to save (download) the savegame on my pc and then load it to another computer.

Save the "savegame" as json to pc

Code: Select all
+ Button: On clicked
-> System: Save game to slot "mysave"

+ System: On save complete
-> Browser: Invoke download of string SaveStateJSON with MIME type "application/json" and filename "mysave.json"


Load the "savegame" from pc to the app

Code: Select all
+ FileChooser: On changed
-> AJAX: Request FileChooser.​FileURLAt(​0​) (tag "mysave")

+ AJAX: On "mysave" completed
-> System: Load game from JSON string AJAX.​LastData



c3 demo: link
B
22
S
9
G
13
Posts: 141
Reputation: 8,811

Post » Wed Aug 23, 2017 6:46 pm

You are amazing! This is so helpful, thank you so much! This will help a lot of people! :)


(One question, in my case it only works once. Meaning if I make new changes to the blocks and load the .json that I saved it wont update the blocks.)
B
14
S
2
Posts: 67
Reputation: 2,044

Post » Wed Aug 23, 2017 7:08 pm

I was able to get it to reload the json by adding a request URL to Button2 and removed the fileChooser On Changed event.

Code: Select all
Tag "save"  -  >  FileChooser.FileURLAt(0)


Image
B
14
S
2
Posts: 67
Reputation: 2,044

Post » Fri Aug 25, 2017 12:35 pm

@Kyatric maybe at this to how do I - faq? Or isn't this seen as a faq?
B
28
S
6
G
7
Posts: 678
Reputation: 5,676


Return to How do I...?

Who is online

Users browsing this forum: cjbruce and 0 guests