Skip to content

Editing saved games with ShadowKeeper

jbrownosjbrownos Member Posts: 7
edited December 2012 in General Modding
There's an excellent save game editor called ShadowKeeper that works with the original game engine. Trying to run it on Baldur's Gate: Enhanced Edition doesn't work. The reason for this is because the original games stored saves and user data in the program directory. That now tends to be discouraged for a number of reasons, and the Enhanced Edition stores them inside the user's directories.

I originally found a couple of threads on here that described some possible steps to get things working. I had some trouble initially, but I managed to adapt it and get it working. (Part of the problem was that I didn't install in the default location.) I noticed another thread about making a batch file, and I couldn't help but start playing with the idea.

Anyway, if you put this file in the game's installation directory and run it, it should fix ShadowKeeper automatically:
http://rapidshare.com/files/1048841246/_keeperlinks.bat

Here's the link to download ShadowKeeper:
http://www.mud-master.com/shadowkeeper/


Finally, I'd like to give credit to @Cuv @Aosaw and anyone else involved in figuring out the files needed.
Post edited by jbrownos on

Comments

  • DeeDee Member Posts: 10,447
    Thanks for doing this @jbrownos, although it belongs in the Modding forum, not Bugs. I'll move it there now.
  • DeeDee Member Posts: 10,447
    Worked like a charm!

    @belgarathmth will love this.
  • BelgarathMTHBelgarathMTH Member Posts: 5,653
    edited December 2012
    @jbrownos, @Aosaw, (couldn't get it to work, at first)

    EDIT: Okay, I kept tinkering, and I finally got it to work, by studying carefully what it said in that DoS box. It wasn't working because it couldn't overwrite my previous copies of dummy files and folders in the game folder, so I deleted the dialog.tlk copy and the save folder copy I had made, and then it worked.

    So, this does make things much easier, and thank you so much! I think this deserves a sticky, because a whole lot of people are going to want this.
  • DeeDee Member Posts: 10,447
    Had you already copied your save folder into the game folder? The batch creates a shortcut path, which can't be created if the folder already exists.
  • BelgarathMTHBelgarathMTH Member Posts: 5,653
    edited December 2012
    @Aosaw, yes, I've got it now, thanks. See my edit, above.
  • cryptomancercryptomancer Member Posts: 22
    This batch file didn't work for me, but I found out why and fixed it. My problem was that the actual program directories were in the %install path%\Data\00766\ directory and not just in %install path%\. Did none of you have that problem? After I moved everything from that 00766 directory into the main the batch file worked and so did Shadowkeeper but then when I ran bgee.exe it thought my game didn't exist and wanted to redownload everything. Am I alone in having this particular problem?
  • jbrownosjbrownos Member Posts: 7
    edited December 2012

    @jbrownos, @Aosaw, (couldn't get it to work, at first)

    It wasn't working because it couldn't overwrite my previous copies of dummy files and folders in the game folder, so I deleted the dialog.tlk copy and the save folder copy I had made, and then it worked.

    I was actually aware of this problem after I did some testing. The only way I would be able to fix it is to have the script delete any existing folders/file by the names being used. I thought about setting up a prompt to allow the user to choose whether to delete them. I decided I wasn't comfortable with giving the script any ability to delete anything, just in case the user made a mistake or something else went wrong.

    My problem was that the actual program directories were in the %install path%\Data\00766\ directory and not just in %install path%\

    I'm not really sure why some people's installations seem to have a 00766 directory. I can add in a check to see if it exists and adjust the paths accordingly. Unfortunately I don't have any way to test and see if it's working, so somebody else is going to have to try it and let me know.

    I'll see if I can't upload a new copy of the script later today or tomorrow.


    Also, I just wanted to say that anyone is welcome to make changes to the script and redistribute it. I thought about putting something about GPL as a comment, but that seemed kind of silly for a batch file.
  • SelvanSelvan Member Posts: 24
    Can anyone convert this .bat script to XP version? MKLINK is not available on XP. This should be LINKD command but it has different syntax like: LINKD source destination [\D] - i've tried but it didn't work :( Please help me
  • jbrownosjbrownos Member Posts: 7
    edited December 2012
    I've created a new, significantly refined version of the script. It ended up being a lot more work than I expected, but it should resolve most of the potential problems. Namely the following:

    @cryptomancer
    It should automatically detect if the 00766 directory is present. If it is, ShadowKeeper get's set to run out of the \data\ directory instead of the base install folder. If necessary, the script also creates links from \data\data\ to \data\00766\ and to chitin.key to make it work. I tested it the best I could, but someone with \data\00766 might want to check it and let me know.

    @belgarathmth
    If any of the files already exist, the script now asks if you'd like to move them to a backup directory. If the backup directory also already exists, the script asks you to manually delete it and run it again. That way the script never deletes anything under any condition.


    I'll update the first post to link to the improved script. For reference this is the new link:
    http://rapidshare.com/files/1048841246/_keeperlinks.bat

    Here's the old link, just in case anyone needs it:
    http://rapidshare.com/files/3076000053/_keeperlinks.bat

    Selvan said:

    Can anyone convert this .bat script to XP version? MKLINK is not available on XP. This should be LINKD command but it has different syntax like: LINKD source destination [\D] - i've tried but it didn't work :( Please help me

    Unfortunately all of my computers are either Windows 7 or Ubuntu at this point. I would need to find someone with an XP installation or virtual machine where I could install the game. Most people I know don't have XP installed anywhere at this point. Like you said, maybe somebody else can come along and do it.
  • MirenheartMirenheart Member Posts: 41
    edited December 2012
    I just tried it and it won't work for me on the 00766

    Edit: when i run it, it says:

    ---Creating link for Dialog.tlk file...

    symbolic link created for .\dialog.tlk <<===>> .\lang\en_us\dialog.tlk
    ---Creating links for save files, characters, and settings...
    The syntax of the command is incorrect.
    The syntax of the command is incorrect.
    The syntax of the command is incorrect.



    And it creates a shadowkeeper folder in System32, with a dialog.tlk file that has 0kb.
  • cryptomancercryptomancer Member Posts: 22
    I solved my problem by putting the batch file in the %install path%\Data\00766\ directory and it worked just fine since the directory structure you expect exists in that path. Shadowkeeper worked as well believing that the BG2 install directory was %install path%\Data\00766\. Works like a charm. Thanks for the batch file!
  • jbrownosjbrownos Member Posts: 7

    I just tried it and it won't work for me on the 00766

    Edit: when i run it, it says:

    ---Creating link for Dialog.tlk file...

    symbolic link created for .\dialog.tlk <<===>> .\lang\en_us\dialog.tlk
    ---Creating links for save files, characters, and settings...
    The syntax of the command is incorrect.
    The syntax of the command is incorrect.
    The syntax of the command is incorrect.

    And it creates a shadowkeeper folder in System32, with a dialog.tlk file that has 0kb.

    It sounds like the script somehow started with system32 as the current directory. The dialog.tlk file it creates is only a link, so it actually should be 0kB. I have some quick questions, if you don't mind answering them. Did you double-click on the script directly in Windows, or did you happen to open the command prompt first? Is the folder it created in system32 called shadowkeeper or shadowbackup? Finally, what version of Windows are you using, and does your account have administrator access?

    I solved my problem by putting the batch file in the %install path%\Data\00766\ directory and it worked just fine since the directory structure you expect exists in that path. Shadowkeeper worked as well believing that the BG2 install directory was %install path%\Data\00766\. Works like a charm. Thanks for the batch file!

    Can you tell me what's actually in your 00766 folder? Does it contain a bunch of .bif files, or are there any other folders or files that you see in it? I'm really surprised that it worked correctly from that directory. Among other things, I created a link to ..\chitin.key, which should (theoretically) be directly in the installation folder. Provided that's the case, the script would need to link to ..\..\chitin.key in order for ShadowKeeper not to give an error message. I'll think about it and see if I can figure out what might be going on.



    Did anyone with the 00766 directory get the script to work directly from the installation folder? Also, has anyone figured out what causes the different installations? I wish I could get the game to install with the 00766 directory to look at the file structure with it.
  • NotelracNotelrac Member Posts: 2
    edited December 2012
    After several hours, I gave up on the batch file. Then I tried to figure out what the "Shadowrun Install Directory" was supposed to be. I finally got it working as the Data/00766 directory. In there is:
    override -- make this directory manually with the Windows command or "mkdir" in a cmd window
    chitin.key -- original installation
    dialog.tlk -- hard link to the appropriate lang/*/... file
    Baldur.ini, characters, save -- soft links to the same file and directories in .../My Documents/Baldur's Gate - Enhanced Edition
    There is also a "Portraits" directory in .../My Documents/Baldur's Gate - Enhanced Edition, with no link back to the install directory.

    Note that dialog.tlk *must* be a hard link. You cannot use the Windows Explorer "create a shortcut" like you can for everything else.
  • MirenheartMirenheart Member Posts: 41
    @jbrownos I'm running WIndows 7, I do have admin rights, the folder is called shadowbackup, and I guess I'm double clicking it in the window (didn't know there was another way to run it)
  • MichailMichail Member Posts: 196
  • ermoermo Member Posts: 81
    edited December 2012
    @jbrownos:

    As Michail points out, there's another thread on the subject.

    Looking at your script, I'm assuming that you are unaware that some versions of Windows switch the current working directory to \windows\system32 prior to executing commands when run as administrator?

    I encourage you to take a quick look at the updated script source I posted in said thread. Feel free to use any and all elements you find useful.

    Post edited by ermo on
  • DeadstarDeadstar Member Posts: 20
    edited December 2012
    This is all a big waste of time. There is a super simple solution. Download Shadowkeeper, put it in the install directory, the 0766 folder or wherever your baldur.exe is located. Copy bladur.exe and rename it BGMain.exe and put it back in the folder. Go into your lang/en_US copy the dialog.tlk and put it in the install directory. Then go into you documents and copy your save folder. Put that in the install folder as well. Open up Shadowkeeper and direct it to the install directory. You will then be able to open any saved game and edit the characters in it. Just make sure to take the edited save file and put it back in the original save location. Open game and BOOM! done.
  • mtyler11mtyler11 Member Posts: 20
    edited December 2012
    Deadstar said:

    This is all a big waste of time. There is a super simple solution. Download Shadowkeeper, put it in the install directory, the 0766 folder or wherever your baldur.exe is located. Copy bladur.exe and rename it BGMain.exe and put it back in the folder. Go into your lang/en_US copy the dialog.tlk and put it in the install directory. Then go into you documents and copy your save folder. Put that in the install folder as well. Open up Shadowkeeper and direct it to the install directory. You will then be able to open any saved game and edit the characters in it. Just make sure to take the edited save file and put it back in the original save location. Open game and BOOM! done.

    Sorry, but having to move all those files every time I edit a char/savefile to fix a broken game-part is more of a hassle and greater likelyhood of making a mistake with all the file shuffling...
    I like the install once method even if there are a few hoops to jump through...
  • DeadstarDeadstar Member Posts: 20
    mtyler11 said:



    Sorry, but having to move all those files every time I edit a char/savefile to fix a broken game-part is more of a hassle and greater likelyhood of making a mistake with all the file shuffling...
    I like the install once method even if there are a few hoops to jump through...

    You only have to copy the files once, not move them and it's only 2 files and a folder. The only files you would have move would be the edited save files back into the original folder. All you are really doing is tricking Shadowkeeper. Using all those other methods messes with the games actual installation and it gets overwritten when you update and then you will have to run through all those hoops again. Or you can just move your save folder when you want to edit and then put it back. That way no game files get messed up. Simple and easy. It's not like you're going to be running Shadowkeeper every time you start the game anyways.
  • MichailMichail Member Posts: 196
    edited December 2012
    Ok, an idea. Modify the .Bat file, so that it checks if the required files, folders and reg entries exist, skips the necessary steps if they do, and THEN actually starts shadowkeeper. Place the .Bat in the Shadowkeeper folder, place a shortcut to it on the desktop, and voila, you can run shadowkeeper with a simple double click, without hassle, even if your installation is modified, erased, etc.
  • moe182moe182 Member Posts: 26
    Selvan said:

    Can anyone convert this .bat script to XP version? MKLINK is not available on XP. This should be LINKD command but it has different syntax like: LINKD source destination [\D] - i've tried but it didn't work :( Please help me

    download mklink.exe and put it in windows\system32. works perfekt.
  • moe182moe182 Member Posts: 26
    i read everything carefuly, but still got one question:
    shadowkeeper works. but do i really still have to copy the savegames to install-dir and copy it back, after editing? or am i doing anything wrong? if i start shadowkeeper without copying, it finds no savegames...
  • H1gherReflexH1gherReflex Member Posts: 18
    edited January 2013
    I ran the batch file but not entirely sure where I'm supposed to move Shadowkeeper to. I moved the entire folder to Libraries>Documents>Baldur's Gate - Enhanced Edition. Note that I ran the file before moving Shadowkeeper. Couldn't get it to work and I'm pretty ignorant on manually working with anything DOS. So I gave up before reading more on it here but when I loaded up the game all my saved game files were gone. So what now? lol

    EDIT: I found my save games, they were moved to shadowbackup>save

    If I'm to restore them where do they need to go back to?

    2nd Edit:

    Found where to put the save files with a little common sense (it comes and goes) but I'm still having trouble with SK.
    Post edited by H1gherReflex on
  • Xander_XavierXander_Xavier Member Posts: 2
    Anyone figure out how to make ShadowKeeper work with the Steam version of the game?
  • Troodon80Troodon80 Member, Developer Posts: 4,110
    @Xander_Xavier, you can use EE Keeper. Just copy and paste the game executable and rename it to Baldur.exe (so you will should have two executables, BGEE.exe and Baldur.exe). The executable shouldn't even matter provided you click 'Yes' when it asks if the directory is correct.
  • Xander_XavierXander_Xavier Member Posts: 2
    Thank you, however you also need to copy dialog.tlk from the language folder (from the subfolder with your own language) and place it in C:\Program Files (x86)\Steam\SteamApps\common\Baldur's Gate Enhanced Edition. Making the copy of the .exe and renaming it to Baldur and putting it in this folder also seems to be a necessary step, though EE Keeper still works after I deleted the extra .exe.
  • Troodon80Troodon80 Member, Developer Posts: 4,110
    @Xander_Xavier, you should not need to do any other copying if the settings are correct. I specifically made the extra option in EE Keeper so that you wouldn't need to bother with all the extra copying or creation of links to the dialog.tlk file :).
Sign In or Register to comment.