-
Notifications
You must be signed in to change notification settings - Fork 0
DLL Modding ‐ Building Chairloader
Before you can start making C++ mods, you have to build Chairloader from source code on your computer. This ensures that you have a development environment ready and can, if necessary, step into Chairloader code when debugging.
You must install the following software:
-
Visual Studio 2022 or newer (do not confuse with Visual Studio Code)
- Community version will suffice
- When installing, select:
- Workloads:
- Desktop development with C++
- Individual components:
- C++ MFC for latest build tools (x86 & x64)
- C++ ATL for latest build tools (x86 & x64)
- Workloads:
- Git for Windows
- CMake (Latest Release, Windows x64 Installer)
- vcpkg
- Follow only Step 1 - Set up vcpkg. You don't need to do the rest
- Create a folder somewhere for Chairloader
- Right-Click and select "Git Bash Here"
- Copy & Paste this command in the opened console window
- DO NOT use Ctrl+V. It doesn't paste text. Right-Click instead and select "Paste".
git clone https://github.com/thelivingdiamond/Chairloader.git
-
Open the
Chairloader
folder with the source code. -
Create a folder named
_build
-
Open CMake GUI
-
Set "Where is the source code" to the folder with Chairloader source code
-
Set "Where to build the binaries" to the created
_build
folder
-
Press "Configure" at the bottom. Configuration dialog will open.
-
Select:
- Specify the generator for this project: your Visual Studio version
- Optional platform for generator: x64
- "Specify toolchain file for cross-compiling"
-
Click Next.
-
Specify the Toolchain file:
path_to_vcpkg/scripts/buildsystems/vcpkg.cmake
-
Press Finish.
-
Wait for all dependencies to download and build. This may take up to 10 minutes but it will only happen once.
-
You should see something like this:
-
Set
PREY_DLL_DIR
to wherePreyDll.dll
is.
Example:F:/Games/SteamLibrary/steamapps/common/Prey/Binaries/Danielle/x64/Release
-
Press "Configure" and "Generate"
- In CMake, press "Open Project"
- Or open
Chairloader.sln
file manually. It will be located in_build
folder
- Or open
- Visual Studio will open. Press "Build" -> "Build Solution".
- Wait for everything to build
- Output window should contain this:
========== Build: 30 succeeded, 0 failed, 0 up-to-date, 2 skipped ========== ========== Build completed at 10:10 and took 01:38,606 minutes ==========
- In Solution Explorer, navigate to "Chairloader (Game)" -> "Chairloader.Dll"
- Right-Click and select "Set as Startup Project"
- Press "Debug" -> "Start Debuggung"
- The game with Chairloader in Developer Mode will start
Note: This is an advanced section for experienced C++ developers
Alternatively, you can use CLion, Rider or VS Code. But you must use the Visual Studio Build Tools compiler. There is no guide on how to set everything up. You're on you own.
Chairloader can be built using clang-cl
compiler in MSVC compatibility mode. But that mode still requires you to install Visual Studio Build Tools.
MSYS2 compilers are not supported.