-
-
Notifications
You must be signed in to change notification settings - Fork 27
Windows Build Instructions
mastercoms edited this page Aug 12, 2021
·
34 revisions
DISCLAIMER: If you are not a developer, building the game from source is not what you want. Use the pre-built Releases. Also, building this on Mac/Linux, while possible, is not covered here. Please let us know if you get it to work!
- Requirements:
- Have the following set:
-
Environment variables:
Name Value VALVE_NO_AUTO_P41PreferredToolArchitecturex64 - Registry keys:
Path Name Type Data HKLM\SOFTWARE\WOW6432Node\Microsoft\VisualStudio\10.0\Projects\{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}DefaultProjectExtensionString (REG_SZ) vcproj
-
Environment variables:
- curl (included with Windows 10 build 17063 or later)
-
Visual Studio 2019 Community Edition. The required installation components are:
- Desktop development with C++
- C++ MFC for latest v142 build tools (x86 & x64)
- Have the following set:
- Open
Developer Command Prompt (or PowerShell) for VS 2019. - Clone the repository. For example, with git:
git clone https://github.com/mastercomfig/team-comtress-2.git -
cdintoteam-comtress-2/src. - Run the following commands:
.\download_libs.bat(alternatively, you can open the project in VS and build both the Debug and Release configuration for the project)msbuild /m /p:Configuration=Debug thirdparty\protobuf-2.6.1\vsprojects\libprotobuf.vcxproj msbuild /m /p:Configuration=Release thirdparty\protobuf-2.6.1\vsprojects\libprotobuf.vcxproj- For Release:
.\creategameprojects_dev.bat - For Debug:
.\creategameprojects_debug.bat
- For Release:
- Open
.\games.sln. - Select all projects. Go to
Properties > C/C++ > Language > C++ Language Standardand setlanguage standardtoC++17.- Make sure they are set for
All Configurations. - Configuration needs to be changed to
Releaseif you want to build for Release.
- Make sure they are set for
- Build the VS project.
- The executables are placed at:
Project Path Client (TF)..\game\hl2.exeServer (TF)..\game\srcds.exe
- Copy the contents of the
game_clean/copyfolder intogame/. - Copy your current TF2 installation to
..\game(relative to your repository, outside of it), skip replacing files. - To setup debugging in Visual Studio:
-
Client (TF)(hl2.exe):- Right click
Client (TF), go toProperties > Configuration Properties > Debugging, and set the following:Command$(SolutionDir)..\game\hl2.exeCommand Arguments-steam -game tf -insecure -novid -nojoy -nosteamcontroller -particle_fallback 2 -allowdebugWorking Directory$(SolutionDir)..\game- Note: Paths here are relative to your copy of the repository (same place where
games.slnis located).
- Note: Paths here are relative to your copy of the repository (same place where
- Right click
Client (TF)and chooseSet as Startup Project.
- Right click
-
Server (TF)(srcds.exe):- Right click
Server (TF), go toProperties > Configuration Properties > Debugging, and set the following:Command$(SolutionDir)..\game\srcds.exeCommand Arguments-game tf -console -nomaster -insecure +sv_pure 0 -maxplayers 32 +sv_lan 1 -allowdebugWorking DirectorySame as Client (TF).- Note: Paths here are relative to your copy of the repository (same place where
games.slnis located).
- Note: Paths here are relative to your copy of the repository (same place where
- Right click
Server (TF)and chooseSet as Startup Project.
- Right click
See the Valve Developer Wiki for another explanation of the last two steps.
| Option | Description |
|---|---|
-sw |
Force windowed mode. (Same as -startwindowed, -window, and -windowed) |
-border |
Enable window borders. |
-w WIDTH -h HEIGHT
|
Set the resolution. (Same as -width and -height) |
+map MAPNAME |
Automatically launch a map on startup. |