![]() |
Another Source SDK question ...
Hi, it's me again :|
after the hint to the wiki, I was finally able to get my dev environment set up for plugin development. Thanks again. Now, next question. I studied some of the emtpy-plugin source code and it seems to me that Valve wants me to use the IPlayerInfo interface to interact with the players in the game, creating an instance to it from the entity (edict_t*) passed to the plugin callbacks. Like: IPlayerInfo *playerinfo = playerinfomanager->GetPlayerInfo( pEntity ); OK. So far so good. But having a look at the interface's methods, it seems there are only some getters and status vars, but no setter methods !! In HL1, there was the nice v-structure accessible in the edict_t* where I could manipulate some properties of the entity directly, like: pEdict->v.takedamage = DAMAGE_NO; for a given player entity. So, I poked around a bit further and found, in class CBaseCombatCharacter, some methods that deal with taking damage, using m_takedamage to determine if damage is caused or not. However, in the plugin, I cannot access this member that easy. I think I need to create a CBaseCombatCharacter instance from pEntity, but how ? What is the correct way to set m_takedamage ? Or is there a totally different way to achieve the same ? Thanks BotUser P.S.: Why is there no class diagram to show the design of the source SDK classes in the SDK documentation ? This would help greatly. |
Re: Another Source SDK question ...
Yes, we have the same problems here. Valve's interfaces are nice, but either they don't want us to mess around with the entities, or they thought people would only need to *read* stuff and not write it (so as to write only stats plugins...) :(
I'm moving this thread to the HL2 SDK coding forum btw |
Re: Another Source SDK question ...
Thanks for your reply, PMB.
This doesn't sound very encouraging 8o Having only read access to player entites will make a lot of plugins just impossible. Either Valve will fix that or we might have to find some ugly hack around it without using their interfaces >:( |
Re: Another Source SDK question ...
Browse around the SourceMod forums and look at some of the things they are doing there...
http://www.sourcemod.net/ ...some people would consider modifying C++ vtables kind of "hackish" and you might not want to do things that way, but for now, that's about the only way to modify CBaseEntity or CBasePlayer member variables. botman |
Re: Another Source SDK question ...
Thx for the link, botman.
I read the tutorial at http://www.sourcemod.net/forums/viewtopic.php?t=273 Man, that's some hack ! CBaseEntity_CreateFunc CBaseEntity_Create = (CBaseEntity_CreateFunc)0x22227F00; LOL !o_O Valve should definitely provide a way to access the entities legally. Cmon. This is ridiculous. Gonna try it anyway ;) |
Re: Another Source SDK question ...
LOL!
I was about to try the same memory scan thingy to find the address of the CGlobalVars instance in the game DLL, because HL2DM doesn't export it yet! But yeah... this is ridiculous :D Things going at the pace they are going, I believe there will be a *MAJOR* SDK update in a few months. |
Re: Another Source SDK question ...
PMB, let's hope you'll turn out right and they'll give us some nice SDK update 8)
|
Re: Another Source SDK question ...
Quote:
CBaseEntity and CBasePlayer vars can often be accessed by changing from private to public in the ".h" files, but you better of accessing the functions reading and setting them (which often are private but can be changed to public). But you might more often be interrested in hooking the functions calls than actually read the vars as they get updated in some complex ways (f.ex the player damage stuff)... Also some local function variables are possible to access by hooking other appropriate functions... /X |
Re: Another Source SDK question ...
I contacted Valve yesterday asking if they are planning to update the server plugin interface soon.
Quote:
Quote:
|
Re: Another Source SDK question ...
I believe they want to limit the mess there was in HL1 with all these "fun" plugins doing weird things to players all the time.
*edit* Steam news tell me that the HL2DM interface update is planned for this thursday =) |
All times are GMT +2. The time now is 04:07. |
Powered by vBulletin® Version 3.8.2
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.