Posted by: Persuter
Date posted: May 19 2003 User Rating: 5 out of 5.0 | Number of views: 8318 Number of comments: 7 | Description: For VC++ 6.0 ONLY |
Setting up the Half-Life SDK is very simple if you know how to do it, but unfortunately many people get stuck on it. This article will attempt to outline, in a step-by-step manner, exactly how to set up the Half-Life SDK. If you're already coding in HL, you can probably skip this. Rank beginners ONLY.
Step 1: The first step is, of course, to download the Half-Life SDK. As of this writing, the latest version was 2.3. This, of course, may have changed by now. Google for Half-Life SDK and download the "Source-Only" version. This contains only the source code. It comes in a small setup program. The only choice you will have to make is where to extract the files to. In this case I have chosen C:\projects\Tutorial SDK.

Step 2: Now we have extracted the SDK to the folder. Inside that folder will be two folders: Multiplayer Source and Single-Player Source. Ignore Multiplayer Source (in fact, you can delete it if you want to). Single-Player Source is the full Single Player/Multiplayer source as it extists in the latest patched retail game.
(At this point, I would suggest copying Single-Player Source into a backup folder, so that if you want a clean SDK again you won't have to redownload it.)
Enter the Single-Player Source directory. You will find the following directories:

dmc and ricochet are the sources for the Valve-produced mods Deathmatch Classic and Ricochet, respectively. You can ignore them. Most important are the cl_dll and dlls directories, which are the client and server code, respectively. common, pm_shared, and engine all hold code common to both projects. pm_shared is the physics code, and engine holds the headers for the interface to the HL engine.
Step 3: Now, open up your copy of Microsoft Visual C++ 6.0. (In my version there are a lot of buttons referring to Source Code Control. These will probably not be in your version. Other than that, the screenshots should look exactly the same as your screen. Note that this IS NOT Microsoft Visual C++ .NET.) Open the File Menu and click New. Now click the Workspaces tab. Type in the root directory of your SDK in the Location window. Then type in whatever name you want your workspace to have. Note that it will try to change the Location name. I changed it back, but you can put it wherever you want.

Hit OK. Your screen should now look like this:

Step 4: Right-click on the Workspace in FileView, and click Insert Project Into Workspace.

Now navigate to the dlls folder in your sdk directory, and click on hl.dsp.

Step 5: Your workspace will now have an hl project in it. Repeat step 4, but navigate to the cl_dll folder, and click on cl_dll.dsp. Your workspace is now complete:

Step 6: Now we have to set up the project to deposit the compiled dll files in the proper directories. Stay in the Settings menu. Click on the Link tab. Now, on the left side, click on hl. Finally, type in the output file name. It should look like this:

Step 7: Click cl_dll on the left side, and type in the client.dll's output directory and name:

Step 8: Set up debugging as showed in omega's VS 6 debugging tutorial.
Step 9: Open the Build menu, and click Set Active Configuration. Click on cl_dll - Win32 Debug and click OK.

Step 10: Hit F7. If all has gone well, a list of files will start coming up at the bottom of your screen as the client dll compiles. Finally, it will terminate with:

If it has any errors or warnings, you have probably done something wrong (or you do not have the latest service pack of VS 6.0).
Step 11: Repeat Step 9, except select hl - Win32 Debug.
Step 12: Hit F7 again. Again you will see a list of files followed by:

Again, if it has any errors or warnings, start over from the beginning.
Step 13: Skipped (13 is bad luck).
Step 14: There is no step 14. You're done! Dive into the SDK with vigour and confidence, now that you have mastered the arcane art of downloading and opening it. |
|
User Comments
Showing comments 1-7
|
Very good tutourial, thanks :) |
|
|
This is going to help me out heaps as I try to learn how to code |
|
|
Thank you so much for taking the time to put this tutorial together - definitely the most comprehensive one available on the topic :o) |
|
|
Awesome tutorial, I looked around for quite awhile before finding this tutorial. The only one I found for the current version of the SDK. |
|
|
A small addendum: This will only set up the SDK to build the debug versions. When you are ready to build a release version for your alpha, repeat steps 4 and 5, but change the "Settings For" combo box to "Win32 Release". Also, if you don't see the workspace view to insert your project, go to View -> FileView. |
|
Awesome tutorial. 5/5 Thanks for helping me set it all up :) |
|
You must register to post a comment. If you have already registered, you must login.
|
296 Approved Articless
5 Pending Articles
3940 Registered Members
2 People Online (55 guests)
|
|