transfer save files between games

Get help using Construct 2

Post » Sun Oct 27, 2013 2:10 pm

I'm making my game using the Node Webkit exporter, and releasing it in episodes (separate game files). I want to be able to allow the player to make a save file at the end of each episode that can be carried over to the next episode so they can retain all of their stats and acheivements. Is there any way to do this?
B
20
S
6
G
2
Posts: 210
Reputation: 2,799

Post » Sun Oct 27, 2013 10:14 pm

I was just thinking about this. Since I'm using the Node Webkit, every time I save the full state of the game it creates a file somewhere on my computer right? Would I be able to just find that file and then copy it into the directory of the next episode of my game and load it by name from within the new project?
B
20
S
6
G
2
Posts: 210
Reputation: 2,799

Post » Mon Oct 28, 2013 12:34 am

@LDC Studios :

Not sure if how I'll do it could be good but:

-I'll first create a folder named LDC Studios inside the user folder
-Have (maybe) 1 subfolder for the game name, and inside it, and a subfolder with all the files needed for an episode episode, and a file containing all data you need to save in a file in the game folder

A picture to explain
Game design is all about decomposing the core of your game so it becomes simple instructions.
B
53
S
22
G
18
Posts: 2,122
Reputation: 17,123

Post » Mon Oct 28, 2013 3:22 am

I still have a lot to learn about this engine. I don't understand how to work the JSON yet or even really the Webkit. I've just been fooling around with the system and accidentally figuring things out so far. I have looked at a bunch of tutorials for these things though. Is there one that could break it down very simply for me that you could recommend?
B
20
S
6
G
2
Posts: 210
Reputation: 2,799

Post » Mon Oct 28, 2013 4:25 am

your making it way to hard on your self...
just use the webstorage feature.     create a localvalue "score"
or what have you..
it saves to the users computer.
then in the next release or even another game completely ..
you can call that data back with the localvalue.   

hope this helps :)
Image
B
26
S
4
G
3
Posts: 147
Reputation: 4,875

Post » Mon Oct 28, 2013 4:28 am

Oh... Well that does sound much easier! I didn't realize it actually saves it straight to the user's computer. Alrighty then, thanks so much to both of you!
B
20
S
6
G
2
Posts: 210
Reputation: 2,799

Post » Mon Oct 28, 2013 4:31 am

best of luck,   just be sure to use the correct format.
webstorage.localvalue("scores")
Image
B
26
S
4
G
3
Posts: 147
Reputation: 4,875

Post » Fri Feb 13, 2015 4:23 am

It's been a long time since this thread was used, but I've finally come to the point where I need to apply this function to my project. I've been digging through tutorials and trying everything that I can, but I can't seem to get the stats from Part 1 of my game to load onto Part 2. Could somebody load 2 capx files, one file with an alterable variable and the other with a function that loads the variable? I haven't been able to find anything like this in tutorials so if somebody can help out that would be awesome!
B
20
S
6
G
2
Posts: 210
Reputation: 2,799

Post » Fri Feb 13, 2015 10:32 pm

I'm pretty sure C2 (Or maybe the browser itself) does something internally to *stop* what you're trying to do, from happening. Basically, if it's a different C2 project, it won't read/write to webstorage values from another project, even if they have the same name. It makes sense when you think about it in the context of browser gaming - if I'm playing 2 different games at different times in the same browser, and they both have a key called 'score', you obviously don't want that value to conflict.

In order to do what you're trying to do, you'll either need to find where NW is saving the values (I haven't looked into this, I think it's somewhere in appdata) and do something with that, or, you'll want to create your own save file using the NW plugin's file i/o features, and monitor where users are installing each 'episode' so they can all access that file.

There's probably another way to do it, but those are the options that first come to mind.
B
92
S
31
G
24
Posts: 3,191
Reputation: 32,689

Post » Sat Feb 14, 2015 4:18 pm

Great tips, and thank you for the quick reply! I actually just found out that if you use the quick save function it will still load everything up on the next games as long as the .exe files are the same name. Tried it out and sure enough...
But I'm still gonna look into doing it the way you've suggested as well. That way does seem like the more secure method in the long run. Thanks again for your time and help!
B
20
S
6
G
2
Posts: 210
Reputation: 2,799

Next

Return to How do I....?

Who is online

Users browsing this forum: Lancifer, richcoz81 and 24 guests