Open the projects.sln from the projects directory in the downloaded Half-life Master
C:\_Projects\halflife-master\projects\vs2010\projects.sln
Note: You may see the following if you are using a version of Visual Studio newer than 2010 Simply click
OK and let it work. This is the conversion process I noted earlier.
I also suggest you change the color scheme to
Dark to make viewing and editing the code easier. This can be done from
Tools > Options > Environment > General and setting
Color Theme to
Dark To the right hand side of the
IDE note the
Solution Explorer which should have 6 projects included:
The one of interest to us is
hldll as highlighted in bold (
Bold highlighting indicates that it is the start-up project )
If it is not highlighted in bold simply right click on it an Select
Set as StartUp Project. We need to make some changes to
hldll’s properties. To access these simply right click and select
Properties.
Firstly let’s change
Configuration in the top left corner to “
All Configurations”. This means that changes we make to the properties page will propagate through all project configurations in this case both
Debug and
Release.
Then we should turn off the post Build process which can be disabled by setting
Use In Build to
No in
Configuration Properties > Build Events > Post-Build Event ( This command when it works correctly would have copied the complied
DLL to the Mod directory, simply put for the scope of this tutorial we do not need it )
Next we must Change under
Configuration Properties -> General the
Output Directory from:
$(Configuration)\$(ProjectName)\
to the directory inside your Half-Life installation where hl.dll resides. In my case it is here:
D:\Programs\Steam\SteamApps\common\Half-Life\valve\dlls\
If we want to be able to debug our code within Visual Studio we need to tell Visual Studio where
hl.exe resides.
Under
Debugging -> Command provide the path to
hl.exe.
For me this is:
D:\Programs\Steam\SteamApps\common\Half-Life\hl.exe
Add the following to Command Arguments:
–windowed –debug –dev
Set the working directory to the root Half Life Directory,
in my case:
D:\Programs\Steam\SteamApps\common\Half-Life\
We should
Unload the remaining Projects in the solution that we are currently not using. Right click on all unwanted projects (hl_cdll, dmcdll, etc..) and select
Unload from the menu.
hldll should be the only remaining
“loaded” project.