Author Topic: How do you transfer save information between multiple games?  (Read 2173 times)

Minverva

  • Active Member
  • ***
  • Posts: 126
  • Karma: +0/-0
    • View Profile
I've seen it done in the Protector and Mardek games. Can this be done without using a server?

I only need to transfer a very small amount of data.

Spencer

  • Member
  • **
  • Posts: 26
  • Karma: +0/-0
    • View Profile
I'm not too familiar with how Flash is implemented, but I did a bit of digging and I believe you can output to a file (probably a .txt) that the player can save and then reupload in the other game. Alternatively, you could try caching in the player's browser... but I have no clue how to do that.

Minverva

  • Active Member
  • ***
  • Posts: 126
  • Karma: +0/-0
    • View Profile
With the text you mean like a code players have to copy and paste?

I don't think that will work for my purposes since this very much needs to be behind-the-scenes.

I understand that this process uses something in addition to actionscript like javascript, PHP or MySQL, but I'm totally unfamiliar with them and I think a server might be required for some of this to work.

That's why I was wondering about the Protector/Mardek series's - I rather doubt they are using servers to transfer save file info between games.

Spencer

  • Member
  • **
  • Posts: 26
  • Karma: +0/-0
    • View Profile
Not so much a copy-paste but the same idea. Most simple saving in games is done in a .txt file (sometimes a .dat file, but it's the same thing) where you decide what information needs to be saved (such as the level, checkpoint, lives, and score for example) and then you save that information as text. So, for example, a "save" would output a text file with: 3|2|5|3000, and when it is "loaded" your parser would read it in as level 3, checkpoint 2, with 5 lives and a score of 3000. This is something I understood how to do in C++ and GameMaker but I'm clueless as to how to do it in actionscript. In either previous example, the program or game also has access to some local files and usually makes the save file itself, so I'm not sure how that would translate into Flash.

I did a tiny bit of investigating into the Mardek series, and it seems like Flash can save some files onto a computer, based on user settings... but I'm clueless as to how to do it. This seems like more of an actionscript question than a flixel one, and that being the case I'm afraid I can't be of too much help. But I'm sure that Mardek has done this through caching (or cookie-ing or whatever) and not servers. You may want to ask pseudolonewolf as to how he implemented it.

Minverva

  • Active Member
  • ***
  • Posts: 126
  • Karma: +0/-0
    • View Profile
Yeah I'm pretty sure it is cookies as well.

I wonder if I could just give my subsequent projects the same project name? Or maybe that would screw things up too much.

paala

  • Contributor
  • ****
  • Posts: 250
  • Karma: +0/-1
    • View Profile
I think you can use the same .sol file with FlxSave. If you modify the FlxSave to use same name it will use same save.

Minverva

  • Active Member
  • ***
  • Posts: 126
  • Karma: +0/-0
    • View Profile
I think you can use the same .sol file with FlxSave.If you modify the FlxSave to use same name it will use same save.

So let me see if I understand. In "Mode" it saves like this:

Code: [Select]
if(save.bind("Mode"))
{
if(save.data.plays == null)
save.data.plays = 0;
else
save.data.plays++;
FlxG.log("Number of plays: "+save.data.plays);
}

Are you saying, "Mode" is the name of the sol file and any other flash program can access it if I give it the same name? I don't need the project names to be the same?

paala

  • Contributor
  • ****
  • Posts: 250
  • Karma: +0/-1
    • View Profile
Check:
http://forums.flixel.org/index.php/topic,2137.msg36814.html#msg36814

It should work on multiple games too, I think.

Minverva

  • Active Member
  • ***
  • Posts: 126
  • Karma: +0/-0
    • View Profile
Thanks, very interesting. Figures it would be auriplane - I'm in love!

Btw, are you getting a request to login from that page? The website in question seems to be some German computer academic's website.

paala

  • Contributor
  • ****
  • Posts: 250
  • Karma: +0/-1
    • View Profile
yes I do , don't know why.