Launching from Visual Studio
In this tutorial you will learn how to launch your mod from within Visual Studio 2005, 2008 or 2010, allowing you to quickly test and debug changes. The fictitious mod used in the examples is called MyMod. When following the steps, replace it with the name of your own mod.
Setting the debug command line
- Right click the Client project and go to Properties > Configuration Properties > Debugging.
- In the Configuration drop down at the top left choose All Configurations.
- Select the Command field, click the drop down arrow, and choose Browse...
- Navigate to C:\Program Files\Steam\steamapps\your user name\half-life 2 episode two\ (or the respective source sdk base if you created a mod from scratch) and select hl2.exe Note: 64 bit computers will use Program Files (x86); Ep1 engine users must use the
\source sdk base\folder instead.
- Select the Command Arguments field. Enter the following, replacing MyMod with your own mods directory. Afterwards, click OK:
-allowdebug -novid -game "C:\Program Files\Steam\steamapps\SourceMods\MyMod"
There are several ways to begin debugging your mod.
- Press F5
- Main Menu > Debug > Start Debugging
- Find the button in the toolbar that resembles a green play arrow, also displayed as an icon next to the above menu option.
A message will appear indicating that symbols cannot be found for hl2.exe. This simply means that there is no debug information for hl2.exe, but we aren't particularly interested in hl2.exe itself. It is our Client.dll and Server.dll made by our project that we will be debugging. Check Don't show this dialog again and click Yes. Your mod will now load several modules, and several seconds later your mod will appear. It is recommended to edit the video options, and select windowed mode. This will make it easier to switch back and forth between your mod and VS.