1st Mod: Compiling Custom Content? Created 17 years ago2007-11-17 00:25:21 UTC by StoneFrog StoneFrog

Created 17 years ago2007-11-17 00:25:21 UTC by StoneFrog StoneFrog

Posted 17 years ago2007-11-17 00:25:21 UTC Post #238671
Hiya, I'm working on my first HL1 mod ('tis a single player campaign). I've already gotten the game to appear in the games list, have tweaked the menu, added a background, and the works.

I've been working in Microsoft Visual C++ 2005 Express on making new weapons.

I'm trying to make an electrified crowbar.

I've made a copy of the crowbar.cpp file and changed various animations and sounds, but I still have some questions:

1) How do I add the actual content to the mod? I heard you are supposed to compile the project file into client.dll or something.

2) I can set weapon damage in the skill file. However, the skill.cfg file has names for weapons like "sk_plr_crowbar1". I searched through the .cpp files, but can't find a thing. How can I tie names like this to the events of attacking with a weapon?

3) A bit of a silly question. The .cpp file shows how you add sounds and whatnot to a weapon, but how do you add a muzzleflash? I cannot find anything in the MP5 cpp file. Is it model based?

Thanks for your help.

Also, finally, anybody know of any good HL1 modding sites? I can't find many. Most resources on modding nowadays are for HL2...
Posted 17 years ago2007-11-17 08:00:33 UTC Post #238679
http://www.snarkpit.net/editing.php?page=tutorials&game=HL&id=223

Have you read a c++ book or something like that before?
Posted 17 years ago2007-11-17 13:00:44 UTC Post #238701
I have had no experience with C++, though it seems very similar (apperance-wise and in syntax) to ActionScript, which I have worked with.

I do not intend to do any major coding, merely weapon/monsters that are primarily just standard HL ones, with minor changes such as sounds and models. For all these things, I have found the single player source files to pretty much be sufficient for that.

Also, I heard MSVC 6.0 works better for HL, due to it being the version HL was coded in. I've gotten ahold of a download of that, which should hopefully make building less painful.
UPDATE - I keep getting "unresolved external symbol" errors when I attempt to build my client_dll file, and even when I try to build the default one that the SDK installs! For example:
ammo.obj : error LNK2001: unresolved external symbol __ftol2_sse
I cannot figure out what is causing this. I even made a full copy of the SDK for my mod to ensure there were no directories I left behind - still get these errors! Why?
Posted 17 years ago2007-11-17 17:49:31 UTC Post #238711
Yes, you should definitely be using MSVC6 for your HL1 coding. Not only should it compile the SDK without any problems, it's just better in general than MSVC '05, which produces bloated files that rely on DLLs not included in Windows by default. Also, I strongly suggest you learn C and then C++ before even thinking of doing any HL coding. Otherwise you'll be stuck copy-pasting code from tutorials without even understanding what it means/does.

1) It depends on what project you're building. There are two, the server DLL and client DLL. To open them, open up [SDK]/Single-Player Source/dlls/hl.dsp and [SDK]/Single-Player Source/cl_dll/cl_dll.dsp, respectively. The server project holds code for things like weapons, monsters, triggers, etc., while the client project holds code for things like the HUD and keyboard input. Once you've got one of these projects open you can edit the different source files, or add new ones (Project -> Add To Project -> New). Once you're done you need to compile. This can be done by clicking Build -> Build xxx.dll, or just hitting F7 (it may take a while). When it's done, the resulting DLL file will be in one of two places: if you're building hl.dsp, it'll be in [SDK]/Single-Player Source/dlls/Profilehl as hl.dll. If you're building cl_dll.dsp, it'll be in [SDK]/Single-Player Source/cl_dll/Debug as client.dll. These DLLs go into your mod's dlls and cl_dlls folders. If you're trying to add a new weapon you'll need to edit the server project.

2) Look in [SDK]/Single-Player Source/dlls/game.cpp.

3) Read all about HL weapons here.

As for tutorials, you can find a list of them here.

And I'm not sure about your linking problem as I've never encountered it myself, does this happen when you're using MSVC6?
Posted 17 years ago2007-11-17 18:08:38 UTC Post #238713
I find most of the coding tuts from wavelength don't work.
Posted 17 years ago2007-11-17 18:50:19 UTC Post #238719
Welp, I took a break from working with client_dll to work on hl.dll, which I was able to compile with no errors whatsoever, aside from a few syntax ones made by myself which I was able to fix with ease.

It's not a new weapon based off of a pre-existing one, but rather a pre-existing one but with different sounds, damage, etc. Still, it's a start.

Caboose, I'll check your links and see if they are of any help to me.

Also, is the server project hl.dsp? As stated above, I changed a weapon there, tried a map in my mod, it worked perfectly. Client_dll has nothing to do with weapons anyways, if I look in there that's all the VGUI/HUD stuff.

P.S. My mod is single player, if that has any dramatic effect on how these projects should be worked.
You must be logged in to post a response.