View Single Post
Re: Hooking into HL2 DLL ?
Old
  (#9)
botman
Super Moderator
 
Status: Offline
Posts: 280
Join Date: Jan 2004
Location: Plano, TX
Default Re: Hooking into HL2 DLL ? - 17-01-2005

What do you mean by "chain the plugin"?

Plugins in Half-Life2 are implemented similar to the way they are in Metamod. The plugin does not sit between the engine and the game DLL.

In Half-Life2, the engine can call plugin functions when (after) game DLL functions are called. It's more of a branch off from the main engine/gameDLL connection than it is a connection between them.

For example, the engine calls the game DLL GameFrame() function, then when the game DLL returns back to the engine, the engine calls it for plugin A, then plugin B, then plugin C, like this...

engine->GameDLL::GameFrame()
<- GameDLL::GameFrame() returns back to the engine
engine->PluginA::GameFrame()
<- PluginA::GameFrame() returns back to then engine
engine->PluginB::GameFrame()
<- PluginB::GameFrame() returns back to the engine

...it's NOT like this...

engine->PluginA::GameFrame()->PluginB::GameFrame()->GameDLL::GameFrame()

..that would be more like the way the HPB bot hooks the game DLL. The Half-Life2 plugin system does not work that way.

botman
  
Reply With Quote