transfer save files between games

  • 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?

  • 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?

  • 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

  • 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?

  • 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 :)

  • 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!

  • best of luck,   just be sure to use the correct format.

    webstorage.localvalue("scores")

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • 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!

  • 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.

  • 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!

  • You can export the save via Download (Browser object) and import via File Chooser

  • No kidding? I'm gonna have to check that out. Can the Browser object save specific data, like object Variables and Global variables? Also, I'm using the Node Webkit. Will the Browser Object still work for it? I've never touched it before.

  • Node is a "portable Chrome", then Browser object works perfectly.

  • Great I'll be looking into that tonight then! Thank you!

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)