Launching from Visual Studio 2013

From Valve Developer Community
Jump to navigation Jump to search
English (en)Deutsch (de)Русский (ru)Translate (Translate)

In this tutorial you will learn how to launch your mod from within Visual Studio 2013, 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

  1. Right click the Client project and go to Properties > Configuration Properties > Debugging.
  2. In the Configuration drop down at the top left choose All Configurations.
  3. Select the Command field, click the drop down arrow, and choose Browse...
  4. Navigate to Steam\steamapps\common\Source SDK Base 2013 Multiplayer\hl2.exe and select hl2.exe
  5. Select the Command Arguments field. Enter the following, replacing MyMod with your own mods directory. Afterwards, click OK:
    -allowdebug -novid -game "C:\Program Files (x86)\Steam\steamapps\SourceMods\MyMod"
Note.pngNote: Make sure to include the quotes; Change C:\Program Files\ to the right directory if steam is installed elsewhere
Warning.pngWarning: Mods MUST go in the steam install directory. If you configured steam to install games in another directory other than the install directory then see [1] for more information

Beta options

Valve periodically updates the SDK code base. Often, the changes they don't run on the stable SDK base version and we must instead use the 'upcoming' or 'beta' branch. If you don't perform this step you may not be able to launch the client (as of October 10, 2015 you must use the beta_test branch with the latest code). Once you've switched branches give it a moment to update the files.

  1. Open Steam
  2. Navigate to Tools->Source SDK Base (muliplayer or singleplayer) 2013
  3. Right click->Properties->Betas and select beta_test

Launching

There are several ways to begin debugging your mod.

  1. Press F5
  2. Main Menu > Debug > Start Debugging
  3. 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.