Raised This Month: $12 Target: $400
 3% 

cbase.inc


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Greyscale
SourceMod Plugin Approver
Join Date: Dec 2007
Location: strYoMommasHouse[you];
Old 05-07-2009 , 01:16   cbase.inc
Reply With Quote #1

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.
__________________
Greyscale is offline
Fredd
Veteran Member
Join Date: Jul 2007
Old 05-07-2009 , 23:34   Re: cbase.inc
Reply With Quote #2

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.
__________________
Need a private coder? AMXX, SourceMOD, MMS? PM me!
Fredd is offline
Greyscale
SourceMod Plugin Approver
Join Date: Dec 2007
Location: strYoMommasHouse[you];
Old 05-08-2009 , 01:11   Re: cbase.inc
Reply With Quote #3

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
Just gotta finish it
__________________

Last edited by Greyscale; 05-08-2009 at 01:26.
Greyscale is offline
pRED*
Join Date: Dec 2006
Old 05-08-2009 , 02:37   Re: cbase.inc
Reply With Quote #4

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.
pRED* is offline
Fredd
Veteran Member
Join Date: Jul 2007
Old 05-08-2009 , 03:37   Re: cbase.inc
Reply With Quote #5

Then how would you go about declaring manual hooks that use classes like CBaseEntity, CTakeDamageInfo,...etc ?
__________________
Need a private coder? AMXX, SourceMOD, MMS? PM me!
Fredd is offline
pRED*
Join Date: Dec 2006
Old 05-08-2009 , 03:45   Re: cbase.inc
Reply With Quote #6

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.
pRED* is offline
Fredd
Veteran Member
Join Date: Jul 2007
Old 05-08-2009 , 10:59   Re: cbase.inc
Reply With Quote #7

Interesting, i will defiantly look into it in the future lol I'm just too used to using cbase.h...
__________________
Need a private coder? AMXX, SourceMOD, MMS? PM me!
Fredd is offline
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 05:03.


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