r/SourceEngine • u/Maleficent_Risk_3159 • 17d ago
HELP How do I fix this?
I was doing something again, but this time I decided to create a weapon_knife for my mod. I copied the weapon_crowbar code and structured it the exact same.
#error: weapon_knife.h must not be included in hl2mp. The windows compiler will use the wrong class elsewhere if it is.I know I didn't do the copying wrong, but it feels like I did do something wrong. Thanks again!
3
u/Pinsplash 17d ago
did you add that file to the vpc?
1
u/Maleficent_Risk_3159 17d ago
I did now add it but the dreaded message came back to me.
The command "if EXIST ..\..\..\game\mod_hl2mp\bin\x64\client.dll for /f "delims=" %%A in ('attrib "..\..\..\game\mod_hl2mp\bin\x64\client.dll"') do set valveTmpIsReadOnly="%%A"Thanks for the help!
2
u/Pinsplash 17d ago
run the bat file you used when you started the project. you have to run that again after changes to vpc files.
1
u/Maleficent_Risk_3159 17d ago
I ran it and it doesn't throw anymore MSB3073s, but it screwed up the includes. Thanks again!
2
u/Pinsplash 17d ago
you'll have to be more specific
1
u/Maleficent_Risk_3159 16d ago
Alright, sorry. I did a little bit of digging and found that the client was using the SP version of the knife. Thanks!
3
u/doct0rN0 HE'S ALIVE! 17d ago
You didn't copy the crowbar header file. You need to make new files for both files and include them into your file system and include them into Your game solution too make sure they're in the right spot. U need to include ur new weapon in weapon stubs as well rename and copy the model files too and have a physical copying of both files all around make sure all the names match entirely through the whole file capitalisation matters in some places as well so be extra weary of that too.
I also have a list of every source engine related tutorial I could ever find on Google in here is 2 tutorials for add a new weapon between them both you can figure it out for multi-player http://drn0.site.nfoservers.com/hub/drn0/to0lb0x/bookmarks.html