bjornk Posted December 8, 2013 Posted December 8, 2013 FYI, downloaded a snapshot of what's available in the "trunk" and then I modified the code, compiled the DLL. The DLL now places the co-saves inside the actual Saves folder, but this isn't actually what I want. This method completely bypasses MO. I want the co-saves in my MO profile folder along with the fos files. I suppose MO temporarily changes the actual save directory which normally points to %USERPROFILE%\My Games\FalloutNV\Saves\ and it redirects it to <MO_Profile>\Saves. If I can find out how it does that it'll be easy to modify. It should be the master branch, and of course you need nvse v3 source files. Place NVSE EX source files inside the src folder from NVSE. I've figured that out thanks, but what's confusing is that there are two DLLs in the package for users. nvse_extender.dll and nvse_extender_ng.dll. Judging by the file size these are probably either identical or similar. I think the 'ng' one somehow overrides the other. At first I thought that these files are both required, but it looks like that's not the case. Here's the simple change to nx_save_load.cpp in case anyone wants to know how... #include <Shlobj.h> bool setNXSaveFile(std::string sFilename) { std::string falloutDirectory = GetFalloutDirectory(); std::string sUserPath; bool retVal = false; try { WCHAR userPath[MAX_PATH]; if ( SUCCEEDED( SHGetFolderPathW(0, CSIDL_PERSONAL, 0, SHGFP_TYPE_CURRENT, userPath)) ) { std::wstring wsUserPath(userPath); sUserPath.assign(wsUserPath.begin(), wsUserPath.end()); nx_saveFile = sUserPath + "\\My Games\\FalloutNV\\Saves\\" + sFilename; } else if(!falloutDirectory.empty()) { nx_saveFile = falloutDirectory + "Data\\NVSE\\Plugins\\Extender\\Saves\\" + sFilename; } IFileStream::MakeAllDirs(nx_saveFile.c_str()); retVal = true; } catch (std::exception& e) { _MESSAGE("Exception in setsavefile: %s", e.what()); } catch (int n) { _MESSAGE("Exception in getver: %#8.8x", (unsigned)n); } catch (...) { _MESSAGE("Unknown exception in setsavefile"); } return retVal; } and here's the compiled DLL, if you don't use MO, which means that your game is saved inside "My Documents\My Games\FalloutNV\Saves\" folder, you might want to give this a try. <see the post below> I'd better have a look at SKSE's source code regarding its co-saves. Update: SKSE reads the SLocalSavePath variable in the INI file that's given to the game by MO. This setting is overridden by MO and is redirected to "__MOProfileSave__\" folder, instead of "Saves\". I think NVSE doesn't have the utility function GetINISetting() that SKSE has, so it wouldn't be easy for me to read the game setting in run-time. BTW, the "ng" in nvse_extender_ng.dll probably stands for "No Gore", if that's the case I probably don't need it.
jaam Posted December 9, 2013 Posted December 9, 2013 ng does means no gore, for some specific markets.
bjornk Posted December 9, 2013 Posted December 9, 2013 Yup, I think I've managed to make it the SKSE way. #include <Shlobj.h> #include "GameSettings.h" bool setNXSaveFile(std::string sFilename) { std::string falloutDirectory = GetFalloutDirectory(); std::string sUserPath; bool retVal = false; try { char userPath[MAX_PATH]; if ( SUCCEEDED( SHGetFolderPath(0, CSIDL_PERSONAL, 0, SHGFP_TYPE_CURRENT, userPath)) ) { std::string sUserPath(userPath); sUserPath += "\\My Games\\FalloutNV\\"; Setting* localSavePath; if ( GetIniSetting("sLocalSavePath:General", &localSavePath) ) { if(localSavePath && (localSavePath->GetType() == Setting::kSetting_String) ) { sUserPath += localSavePath->data.str; } } else { sUserPath += "Saves"; } nx_saveFile = sUserPath + "\\" + sFilename; } else if(!falloutDirectory.empty()) { nx_saveFile = falloutDirectory + "Data\\NVSE\\Plugins\\Extender\\Saves\\" + sFilename; } IFileStream::MakeAllDirs(nx_saveFile.c_str()); retVal = true; } catch (std::exception& e) { _MESSAGE("Exception in setsavefile: %s", e.what()); } catch (int n) { _MESSAGE("Exception in getver: %#8.8x", (unsigned)n); } catch (...) { _MESSAGE("Unknown exception in setsavefile"); } return retVal; } The code now looks for the INI setting "sLocalSavePath" which is "Saves\" by default, however Mod Organizer overrides it. Anyway, I won't post the DLL as I'm not sure if it's the same as everyone's been using, but I've tested the code above and it works with MO, it should work without MO, but haven't tested it. The game will save both the csv and the fos file in the same folder. If you use MO then it's your profile folder, otherwise it's the default "Saves" folder. Edit: Okay, here's the DLL if anyone wants to try it out.
DoctaSax Posted December 9, 2013 Posted December 9, 2013 Does this account for reading nx data from the old location when loading an old save? Some sort of transfer is probably necessary - nx data in the csv's is supposed to be permanent until cleared; modders count on that.
bjornk Posted December 9, 2013 Posted December 9, 2013 Does this account for reading nx data from the old location when loading an old save? Some sort of transfer is probably necessary - nx data in the csv's is supposed to be permanent until cleared; modders count on that. I suppose you'd have to move or copy your csv files into your normal "Saves" folder before running the game, if that's what you meant. I mean, once you run the game with the code above it won't read the csv files in their old location. PS. In SKSE, there's a similar function called MakeSavePath in Serialization.cpp doing basically the same thing.
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now