Raised This Month: $ Target: $400
 0% 

NPC in CS:S


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
raydan
Senior Member
Join Date: Aug 2006
Old 05-09-2011 , 05:02   Re: NPC in CS:S
Reply With Quote #18

Quote:
Originally Posted by pRED* View Post
You shouldn't need to detour anything new.

Modify the CEntity::AcceptEntityInput handler to do what you want. Which I assume is exactly a copy paste of the sdk version, with a fallback (if the prop name isn't found) to the actual CBaseEntity code.

That should be more or less it. The macros to generate datamaps for a CEntity should work directly from the sdk (I think, maybe) and you don't need to do anything special with them. Code left in there to inject them into the CBaseEntity datamap table needs to be deleted, not sure if that's still in there

the macros to generate datamaps is work
Code:
BEGIN_DATADESC( CBaseNPCMaker )
    DEFINE_KEYFIELD( m_nMaxLiveChildren,        FIELD_INTEGER,    "MaxLiveChildren" ),
...
LINK_ENTITY_TO_CUSTOM_CLASS( npc_maker, info_target, CNPCMaker );
the game will parse "MaxLiveChildren" keyvalue to "info_target" - "m_nMaxLiveChildren"
the problem is "m_nMaxLiveChildren" no exist in that CBaseEntity, and it will overwrite a random memory address in that CBaseEntity. Not the custom entity.

know keyvalues problem now?
raydan is offline
 



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 07:09.


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