Kharen, on 11 July 2012 - 01:58 PM, said:
Great. I've got a little brother who absolutely loves playing the Sonic games, but I don't want to lose my save file. Probably not quite what the program was intended for, but until there's a really awesome mod that catches my eye, that'll probably be what I use it for.
Yeah, you can do that.
Also be aware that CPKREDIR can expand environment variables. So, if several users share a PC, and have their own user accounts, you can use the common variables %USERPROFILE% and %USERNAME%, for example, to keep things separated.
Let's suppose the Dragon Road demo has been released. It uses save file redirection, so you'll find the line "SaveFile=Saves\sonic.sav" in its mod.ini.
This will cause all users on the PC to share that same sonic.sav file - not necessarily what you want. So you could change that line to "SaveFile=Saves\sonic.%USERNAME%.sav", for example, which would automatically be expanded to "sonic.Joe.sav", "sonic.Dave.sav" or whatever the user names are.
But keep in mind that you have to make sure those files exist before you start playing. Just make copies of Dragon Road's original sonic.sav file and rename them accordingly to sonic.Joe.sav etc.
%USERPROFILE% expands to the account's home folder, normally C:\Users\<username> (eg. "C:\Users\Joe"). You could use that as well, like this: "SaveFile=%USERPROFILE%\DragonRoad.sav".
This expansion is done by the ExpandEnvironmentStrings
Windows API function and if you want to get an overview of the existing variables, just open a command prompt (cmd.exe) and enter "set".
But the most useful ones are only USERPROFILE, USERNAME and perhaps APPDATA.
This post has been edited by Korama: 11 July 2012 - 03:02 PM