Posted by: ibutsu
Date posted: Dec 06 2004 User Rating: 3.7 out of 5.0 | Number of views: 9654 Number of comments: 7 | Description: I go through both methods for debugging your modification |
Hello again! This time around I'm going to show you the two methods for debugging your dlls, the first method will run your mod from within the debugger and the second method will show you how to attach the debugger to a running copy of your mod.
Method 1
Okay, this method is a bit trickier to get set up.
First thing you have to do is go to your main steam directory and copy Steam.dll into your \Steam\SteamApps\<steam@account>\half-life 2\bin directory.
Next create a text file in \Steam\SteamApps\<steam@account>\half-life 2\ directory and name it SteamApp.cfg. Now open it up and paste the following into it:
| | | SteamAppId=220 SteamAppVersionId=0 SteamInstallPath="<drive/path>\Steam" SteamAppUser="<steam@account>"
|
Make certain you do NOT put a trailing backspace after your steam directory.
For example, mine is:
| | | SteamAppId=220 SteamAppVersionId=0 SteamInstallPath="E:\Steam" SteamAppUser="ibutsu@gdnmail.net"
|
Now open up Visual Studio.NET and your mods solution/workspace, I have Visual Studio.NET 2002, but 2003 should not be too different. Open up the project settings for the client and server dll and go down to the Debugging section.
Set the Command field to point to \Steam\SteamApps\<steam@account>\half-life 2\hl2.exe Mine is set to: E:\Steam\SteamApps\ibutsu@gdnmail.net\half-life 2\hl2.exe
Set the Command Arguments field to -steam -sw -dev -allowdebug -game "<path to your mod>" Mine is set to: -steam -sw -dev -allowdebug -game "f:\hl2modding\ninjamod"
Make sure Attach is set to No otherwise it will either hang or error.
Apply your project settings and you should be set to go!
Method 2
This method is easy to set up, but it's more of a hassle when you want to debug.
Open up your mod's solution/workspace in Visual Studio.NET and open the project settings dialog for both your client and server dlls and select the Debugging section.
Set the Command field to point to \Steam\SteamApps\<steam@account>\half-life 2\hl2.exe Mine is set to: E:\Steam\SteamApps\ibutsu@gdnmail.net\half-life 2\hl2.exe
Now make sure Attach is set to Yes.
Apply your project settings.
Now when you want to debug, run your run_mod.bat for your mod, once your mod loads, start debugging in Visual Studio, instead of running your mod, it will debug the copy of your mod that is running!
Important:
When using the attach method (method 2), you must exit your mod and NOT stop the debugger, if you stop the debugger using the stop button in the IDE Visual Studio will lock some intermediate files that are used for debugging and you will have to restart visual studio before you'll be able to compile your project again. |
|
User Comments
Showing comments 1-7
If you notice your HL2 no longer loads after the most recent Steam Update, this is because of your copied Steam.dll being old. Delete it.
HL2 just hangs, so you need to either copy a new one every time Steam updates, or don't use Method 1. |
|
|
they changed the way it works now, no need for a cfg/steam.dll in your half-life 2 directory, I haven't tested it yet though. |
|
|
I just copied the commands in the run_mod.bat file into the command section of the debugger and did everything else like valve says to do and it works great so far. Haven't had to debug nething yet though, just use it for quick compiling/testing. |
|
Hi, Whenever my Half life 2 autosaves it pops up a runtime error and I have to restart th whole thing.Is there anyway i can stop the autosave feature? |
|
You must register to post a comment. If you have already registered, you must login.
|
296 Approved Articless
5 Pending Articles
3940 Registered Members
0 People Online (15 guests)
|
|