sucklead Posted March 6, 2021 Share Posted March 6, 2021 I'm working on getting full mod support for Call of Cthulhu: Dark Corners of the Earth.I've got the GOG and retail version working (no DRM) using a hook loader to override all the file opens.I want to get the Steam version working but things are a little more complicated.For Steam running the main exe ends up going through Steam and running C:\Steam\steamapps\common\Call of Cthulhu\install.vdf.Install.vdf defines the exe to run as "Executable" "%INSTALLDIR%\\Engine\\CocMainWin32.exe" which if I change it to "Executable" "%INSTALLDIR%\\mods\\Engine\\DCoTEHook.exe" which is my hook everything works as expected just like the GOG version. So my two questions are:Does anyone know of a better way to do this that doesn't require changing the install.vdf file?andIf that is the only way then what is the best practise way with Vortex to make that change and have it be able to be reversed when the mod is removed? Link to comment Share on other sites More sharing options...
Solution Tannin42 Posted March 7, 2021 Solution Share Posted March 7, 2021 Can't you set up Vortex to run the DCoTEHook.exe directly? I don't think we've ever had a case where we had to modify steam installation files which would be a bit awkward because the moment the game gets updated or files get validated, that change probably gets reverted.If your worry is that running the DCoETHook.exe directly breaks the steam overlay: Usually with steam games if you export the environment variable "SteamAPPId=123456" (use the actual steam id) the overlay should work. You can either do that from the hook exe or you can set up vortex so it sets it when the exe gets started. If you really absolutely have to change the install.vdf file, Vortex uses a node library called "simple-vdf" to read vdf files. Afaik it's supposed to also support writing vdfs but we're not using that ourselves. So you should be able to import simple-vdf, use it to read the install.vdf into a js object, change the value for the executable, dump the file to disk again => 3 lines of code plus some error handling.Within your extension the option "setup" function in the registerGame interface would probably be the best place to do that. It gets called on startup for the active game and any time you change the active game in vortex. Link to comment Share on other sites More sharing options...
sucklead Posted March 7, 2021 Author Share Posted March 7, 2021 Thanks so much that env var was all I needed :)The way it was working was that you'd run the main exe, it would call steam and close the main exe. Steam would then launch the front end launcher and then clicking launch on that would run whatever was defined in install.vdf.Now I just set the env var in the hook and run the exe and everything works as expected. Link to comment Share on other sites More sharing options...
rmm200 Posted March 7, 2021 Share Posted March 7, 2021 Great information for the WIKI - somewhere. Hate for these little tips to get lost. Link to comment Share on other sites More sharing options...
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