Adventure Game Studio

AGS Support => Advanced Technical Forum => Topic started by: KodiakBehr on Wed 05/11/2014 00:35:46

Title: Saving profiles.
Post by: KodiakBehr on Wed 05/11/2014 00:35:46
I have a conceptual question -- I'm working on a game where I want individual players to be able to create their own profiles, if they're on a shared computer.  Saved games would therefore specific to that profile, and no other.  Persistent data in a .dat file would also be specific to that profile, and no other.  How would you go about doing this?
Title: Re: Saving profiles.
Post by: monkey0506 on Wed 05/11/2014 05:05:47
I believe that doing something like:

Code (ags) Select
function game_start()
{
  Game.SetSaveGameDirectory("$MYDOCS$/YourGameName");
}


Should be sufficient for the save files, but IIRC the File operations all work exclusively on the game installation directory and don't support the $MYDOCS$ or $SAVEGAMEDIR$ tags, but yet disallow any paths that are not subdirectories. I'm not sure if any of the currently exposed methods would allow you to get a full path, but if you could get a full path to the $MYDOCS$ directory then you could try and parse the current user and store that in a .dat file in the game installation directory.
Title: Re: Saving profiles.
Post by: KodiakBehr on Wed 05/11/2014 13:10:36
Damn.  That's what I was afraid of.

Thanks anyway for the feedback.