Raised This Month: $32 Target: $400
 8% 

What exact source header files can I use?


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
DiscoBBQ
Veteran Member
Join Date: Jan 2005
Location: Clemson, South Carolina
Old 07-24-2010 , 11:29   What exact source header files can I use?
Reply With Quote #1

Alright, so I am a little confused as to what functions/classes I can access.

My current compile dependencies are "common;public;public\tier0;public\tier1;game \server;game\shared;"
Linking with "lib\common & lib\public"

Does that mean I can reference anything within those header files?

For instance, In my current code, anytime I try to pull a function from util.h, I always receive an 'unresolved external error' (which occurs when there is no implementation in the linked libraries, right?).

For example:
Code:
void CASW_Plugin::FireGameEvent( KeyValues * event )
{

 const char * eventName = event->GetName();

 if(strcmp("marine_hurt", eventName) == 0)
 {

		int index = event->GetInt("entindex");
		edict_t *pEntity = PEntityOfEntIndex(index);
		Vector org = pEntity->GetCollideable()->GetCollisionOrigin();

		//UNRESOLVED EXTERNAL ERROR:
		UTIL_BloodSpray( org, org, 0, 10, 12 );
 }
)
__________________
"Every man is guilty of all the good he did not do"
DiscoBBQ is offline
pRED*
Join Date: Dec 2006
Old 07-24-2010 , 18:45   Re: What exact source header files can I use?
Reply With Quote #2

As a general rule you should stick to files within public/.

The current example doesn't compile because the definition of UTIL_BloodSpray is inside a .cpp file someone in the sdk, and isn't being compiled into your project. You really don't want to add this cpp file to the project as the code within it probably won't match the current game.

The 3 main solutions for this are (in order of preference):

1) Find the definition and reimplement it using code you can access.
2) Lookup the compiled definition of the code inside the valve binary at runtime, known as signature scanning. Lots of information on this around the forums/wiki.
3) Linux only, add the server/engine binaries to your link path and let the loader do the equivalent of signature scanning for you.
pRED* is offline
DiscoBBQ
Veteran Member
Join Date: Jan 2005
Location: Clemson, South Carolina
Old 07-24-2010 , 23:22   Re: What exact source header files can I use?
Reply With Quote #3

That was very informative and answered my question completely,
Thank you Pred.
__________________
"Every man is guilty of all the good he did not do"
DiscoBBQ 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 06:04.


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