-
Notifications
You must be signed in to change notification settings - Fork 29
Setting up Visual Studio for development
First of all, install Visual Studio 2022 with the C++ and game development packages. Any version of VS2022 will work but you might have issues debugging in versions newer than 17.4.5
due to a bug.
NOTE This is not needed if you generated a project using the mod generator.
In order to be able to easily build, install, and debug the game with the SDK / your mod, you need to create a CMakeUserPresets.json
file that points to your game's installation directory. Two sample preset files are provided in this repository as CMakeUserPreses.json-epic_sample
and CMakeUserPresets.json-steam_sample
for Epic Games Store and Steam users respectively. Copy one of these files to CMakeUserPresets.json
, open it, and ensure that GAME_INSTALL_PATH
is pointing to the directory where your game is installed. If you are developing a mod, rename ZHMModSDK.dll (Install)
in projectTarget
to the name of the mod DLL you're developing (eg. MyMod.dll (Install)
).
NOTE This is not needed if you generated a project using the mod generator.
In order to be able to debug the game alongside the SDK / your mod, you must create a launch configuration for Visual Studio. First, create a .vs
folder in the project folder (if one doesn't already exist). Then, copy one of the sample launch.vs.json-epic_sample
or launch.vs.json-steam_sample
files from this repository into .vs/launch.vs.json
based on your game's platform (don't forget to remove the sample extension). Open the copied file, and ensure that exe
is pointing to your game's executable and cwd
to your game's installation folder.
Open the project as a folder in Visual Studio (or right click somewhere in empty space inside the project folder and Open in Visual Studio
). It should automatically detect the CMake project and start configuring itself. This might take some time and VS might freeze in the process, so just let it do its thing.
Once the project has loaded, select the x64-Debug-Install
configuration and the Hitman 3
target at the top of the IDE, and then just click on it: