Need help porting SP weapon to MP SDK

C

CousinPhil

Guest
Well, I followed this tutorial (http://www.sourcewiki.org/wiki/index.php/Porting_Crowbar_To_MP_SDK) and tried to get a basic melee weapon into my MP mod. In this modd, it calls many of the prefixes "crow" for the name of that mod. In mine, I simply changed these instances to "tff" for the name of my mod. Other than that, I virtually followed the tutorial verbatim, however I keep getting a problem when compiling and I don't know what is causing it since it appears that the file is actually there. Here it is, and I'd be very appreciative if someone could help me with this very annoying compile error.

tff_basehlcombatweapon.h
Code:
#include "tff_basehlcombatweapon_shared.h" <--- this is giving me the error

#ifndef BASETFFCOMBATWEAPON_H
#define BASETFFCOMBATWEAPON_H
#ifdef _WIN32

The error
c:\TheFiveFamilies\src\dlls\TFF\tff_basehlcombatweapon.h(7): fatal error C1083:
Cannot open include file: 'tff_basehlcombatweapon_shared.h': No such file or directory
 
I know, due to the length that this will sound really snotty, but have you made sure that the file it asks for DOES in fact exist. (either exists at all or isn't named "crow_basehlcombatweapon_shared.h" ?
 
Yeah, I just checked and it is there along with its .cpp counterpart.

C:\TheFiveFamilies\src\game_shared\TFF\tff_basehlcombatweapon_shared.h
 
Okay. I was looking for something else, and stumbled across your post. I don't know anything about compiling. I just thought I'd offer up that piece of advice. (I've had maps not load because I didn't copy them into the map directory... lol) Sorry if I wasted your time with any of this. Good luck with finding an answer.
 
I will check this file out once I get home.
Should be around 6PM CET.

Can't really give any advice till then. :p
 
CousinPhil said:
c:\TheFiveFamilies\src\dlls\TFF\tff_basehlcombatweapon.h(7): fatal error C1083:
Cannot open include file: 'tff_basehlcombatweapon_shared.h': No such file or directory

C:\TheFiveFamilies\src\game_shared\TFF\tff_basehlcombatweapon_shared.h

Notice how the paths are different. Are you absolutely sure the file (also) exists in that dlls\ dir?
 
I find that many times the editor (using VC++ 2005 Beta) have troubles finding the include files of newly added items... My solution is either to give exact path ("\whatever\whichever.h") or simply include the folder in the global include directories. Meh, I dont use it very much, there's probably an easier way to define it per project.
 
Well, I tried adding the full filepath name to the #include (C:\TheFiveFamilies\src\game_shared\TFF\tff_basehlcombatweapon_shared.h) and it just gave me the same error except this time on files basebludgeonweapon.h and tff_basebludgeonweapon.h

c:\TheFiveFamilies\src\dlls\basebludgeonweapon.h(11): fatal error C1083:
Cannot open include file: 'basehlcombatweapon.h': No such file or directory
c:\TheFiveFamilies\src\dlls\TFF\tff_basebludgeonweapon.h(11): fatal error C1083:
Cannot open include file: 'basehlcombatweapon.h': No such file or directory

So, I added correct filepaths to both of those #includes and then it gave me two more of the same types of errors on two more header files. I then added correct filepaths to *those* #includes and it suddenly busted out with 27 errors upon trying to compile. So I feel like I'm running around in circles a bit here. :p If anyone has any other suggestions, I'd be really grateful as I would very much like to see this mod come to life and not die.

Also, my method for adding filepaths to the #include lines is simply copy-pasting directly from the properties of the files they should be pointed at.
 
I found with that tutorial there were a lot of irrelavant things you had to do.

As the only file you will need to change is the crowbar file itself, this is the only file you need to copy/rename (oh and also the crowbar_stubs file for the client).

This will give you a lot of unresolved externals as none of the basecombatweapon files etc. are included in the MP build by default, but they others can just be included in the build (in .NET 2003) by:

right click on the file in solution exporer -> properties -> excluded from build -> no -> ok.

This saves a lot of faffing about copying files and changing about 10 #include's - but I think there is still one #include which DOES need changing (can't remember it off hand).
 
Well, I'm not sure about the .NET 2003 approach to this,
but in general GNU C++ I would just add -I"\path\to\includes"
and use
#include <tff_basehlcombatweapon_shared.h>

That way the compiler should look in other directories for the files you try to include.
 
Back
Top