![]() |
the new event interface...
I can't seem to be able to hook all the events like before and iterate through all their key/values and display them... it looks like Valve changed the event listening interface and wants us to use something else, but the server plugin sample from the SDK hasn't been updated to reflect it :(
Does anybody know anything about this issue ? |
Re: the new event interface...
You shouldn't have left the hlcoders email list... :)
http://www.mail-archive.com/hlcoders.../msg10848.html botman |
Re: the new event interface...
thank you botman :)
*edit* WHOA!
We've also had a conversation with Alfred regarding the Source interface. For me I see a major flaw in their current design. They use version numbers as if the interface providers were capable of backwards compatibility whereas it's not, which means that
Quote:
Quote:
Quote:
Quote:
Quote:
Quote:
Quote:
|
Re: the new event interface...
I think the engine maintains backward compatibility by keeping EACH version of a class separate. (i.e. the engine keeps a separate copy of version 001, and a separate copy of version 002, and a separate copy of version 003, etc). So that when you ask for version 002, you get EXACTLY that class definition as it was defined at the time that SDK was released. For newer MODs (using a newer SDK) that ask for version 003, they get EXACTLY what the class definition was in the SDK at the time that interface version was released in the SDK (and these class definitions can be completely different from each other).
The engine basically keeps an archive of all the current and previous class definitions and has code that supports each one, so that no matter which interface version you ask for, the engine gives you exactly that one (without any assumed knowledge of what previous versions of that interface looked like). So you shouldn't assume that version C is version B with a little bit more added at the end and version B is version A with a little bit more added at the end. It could be that they created version A, then went "Oh, shit!", we can do this an entirely different way, let's change everything in version B. Then when version C comes out they go, "Oh, heck!", we could have used version A with some minor changes, lets change the class definition again to go back to version A with a couple of minor changes, etc. Each class definition can be completely different than the previous version. It makes the engine a lot bigger and a lot more complicated, but it completely prevents the newer version of the engine from breaking older (not updated) MODs. botman |
Re: the new event interface...
so how do you pick up events with the new SDK, whats the firing method??
I mean, I know I need to make the plugin implement the IGameEventListener2 interface as well, then add the FireGameEvent(IGameEvent*) method into the plugin. Then add a listener to every event I want to catch. But the events never get called, I don't know whats wrong, maybe it's because I'm trying to support both old & new methods at the same time. [edit] 8o ok looks as though yuo can only do one at a time (or maybe it's only certain events that seem to work -- what happens to the bulletimpact event?), after I made an interface to work on both, oh well it's easy to switch between the two. Although I was wondering, you could get the "eventid" from the keyvalues as an integer instead of having to seach the string all the time you can check the integer for the correct event. It doesn't seem to wok with IGameEvent anymore, alwasy returns 0 |
Re: the new event interface...
I have managed to sort of "repair" the event interface in server plugins (I mean make the plugin able to hook ANY event, known or unknown).
Code:
// global variables |
Re: the new event interface...
thanks, I've kinda got it working. I've just makde a command that can be used in the console to tell whether you want the bot to use the new or old method or getting events.
By the way, is there no "eventid" anymore? I posted in hlcoders, no response yet, just wondering if you found the same thing. There used to be an "int" called "eventid" that was a unique number for that event, so instead of comparing the event name string , it's qjuicker to check the event id. |
Re: the new event interface...
no eventid anymore AFAIK.
|
Re: the new event interface...
PMB, does your event code you posted above work in the latest version of HL2DM or CS:S ? I'm getting an odd crash in the gameeventmanager->AddListener (this, pEvent->GetName (), true); line, even though all the gameeventmanager and pEvent are valid pointers and pEvent->GetName() is even returning a valid event name.
edit: nevermind, apparently it was a problem elsewhere that caused a crash there. |
Re: the new event interface...
I might be interested in knowing more about what your problem was because I'm having crashes at level change in the RACC HL2 interface since recently ?
|
All times are GMT +2. The time now is 05:49. |
Powered by vBulletin® Version 3.8.2
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.