-
Notifications
You must be signed in to change notification settings - Fork 29
Setting up CLion for development
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.
After opening the project, you might get prompted to select which profiles you want to use. Select the Debug
profile and disable it.
Go to File > Settings > Build, Execution, Deployment > Toolchains
and ensure that you have a Visual Studio
toolchain as the default and that its architecture is set to amd64
.
Go to File > Settings > Build, Execution, Deployment > CMake
and enable the x64-Debug-Install
and x64-Release-Install
profiles.
After CLion has finished configuring the CMake profiles, you should be able to see your mod or the ZHMModSDK under the run configurations at the top right of the IDE. Select the configuration and then edit it.
First, in the Before launch
options, add the Install
step:
Then, configure the Executable
field to point to your game's HITMAN3.exe
file. For Epic Games Store installations that will most commonly be at C:\Program Files\Epic Games\HITMAN3\Retail\HITMAN3.exe
. For Steam installations that will most commonly be at C:\Program Files (x86)\Steam\steamapps\common\HITMAN 3\Retail\HITMAN3.exe
.
Finally, based on your game's platform, you'll have to configure a few additional options:
If you're using the EGS version of the game, you must add -EpicPortal -epicuserid=userid
to the Program arguments
field. You can find your user ID by running Hitman 3 normally through EGS and looking at its command line parameters using something like Task Manager. If you don't specify your actual user id, you will not have the same in-game progression.
If you're using the Steam version of the game, you must add SteamGameId=1659040;SteamAppId=1659040;SteamOverlayGameId=1659040
to the Environment variables
field. If you're using the Steam demo version of Hitman 3, replace 1659040
with 1847520
.
You should now be able to run and debug the project using the Run or Debug buttons at the top right of the IDE.