AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Snippets and Tutorials (https://forums.alliedmods.net/forumdisplay.php?f=112)
-   -   cbase.inc (https://forums.alliedmods.net/showthread.php?t=91880)

Greyscale 05-07-2009 01:16

cbase.inc
 
Can anyone help me figure out why I can't include cbase.inc?

My compiler is set up with all the correct include paths, I can even include other files in the same directory as cbase.inc.

Code:

c:\hl2sdk\sourcemod-1-2\extensions\zrtools\extension.h(10) : fatal error C1083: Cannot open include file: 'cbase.h': No such file or directory
I'v seen this file included in other extensions just fine, so it appears to be a compiler problem.

I'm kinda stuck until I get this figure out, so if you know how to fix this please do tell. I've tried to code in c++ many many times and it always comes back to cbase.inc.

Fredd 05-07-2009 23:34

Re: cbase.inc
 
you need the following for original engine
Code:

$(HL2SDK)\dlls
$(HL2SDK)\game_shared // for shareddefs.h

and ob
Code:

$(HL2SDKOB)\game\server
$(HL2SDKOB)\game\shared // for shareddefs.h

and before including the cbase.h file just make sure have this somewhere
Code:

#define GAME_DLL
and the reason i have just told you this even though i know that you might think you have the right paths but just to clairify the difference between ob and original cuz that might be you're problem.

Greyscale 05-08-2009 01:11

Re: cbase.inc
 
Well I'm compiling for CS:S.
I didn't even set up any orange box stuff.

Wowwww I didn't even notice the public/ in the current include directories.

I was looking in public/dlls/ not dlls/

Thanks I guess it took me seeing those paths to notice it. Appreciate the help!

EDIT: Great feeling, compiling your first extension :D
Just gotta finish it :P

pRED* 05-08-2009 02:37

Re: cbase.inc
 
What exactly do you need from cbase.inc?

Those headers are from hl2mp (and aren't even necessarily current for that) and may differ (and *do* differ in a lot of cases) for CS:S.

Because of this the assembly your compiler generates won't match the server binary and won't work. It's usually better to reverse engineer the mod you want and access things via offsets.

Fredd 05-08-2009 03:37

Re: cbase.inc
 
Then how would you go about declaring manual hooks that use classes like CBaseEntity, CTakeDamageInfo,...etc ?

pRED* 05-08-2009 03:45

Re: cbase.inc
 
Depends on what you want to do with them.

class CBasePlayer;

should be enough to create a hook with a pointer to one as long as you don't try to access data members or dereference it.

If you want to access data inside it you can create a custom header with the class defined based on the reverse engineered data, or just tell the hook its an unsigned char* and do manual pointer arithmetic to access the members. Once again using the reverse engineered offsets.

Fredd 05-08-2009 10:59

Re: cbase.inc
 
Interesting, i will defiantly look into it in the future lol I'm just too used to using cbase.h...


All times are GMT -4. The time now is 06:24.

Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.