Monthly Target: $400 Donations: $131
 32% 

[DEV] Event detection


Post New Thread Reply   
 
Thread Tools Display Modes
Author
Milo|
Member
Join Date: Jan 2009
Location: Netherlands
Plugin ID:
765
Plugin Version:
1.0
Plugin Category:
Technical/Development
Plugin Game:
Any
Plugin Dependencies:
    Servers with this Plugin:
    2 
    Plugin Description:
    Detects which events are implemented in the game/mod , and when they are fired.
    Old 02-11-2009 , 20:46   [DEV] Event detection
    Reply With Quote #1

    Summary

    This plugin is only intended for plugin developers or people who want to get a better understanding of the inner workings of the game. The plugin contains a big list of names of known events. The plugin will attempt to hook every single one of these and report which can be hooked (screenshot) and which can't. It also notifies you every time any hooked event is fired (screenshot).

    This plugin is not ment to be "always on" on public gameservers. Most users of this plugin will either only use it on a local testserver, or uninstall it once they have the information they need.


    Supported games

    This plugin should work on any mod that supports sourcemod.


    Commands and CVars:
    • eventdetect_version - Shows the version of this plugin.
    • eventdetect_showall - Shows a list of all the events we attempted to hook, and wether or not this succeeded (screenshot).
    • eventdetect_show - Same as above, but will only display events that are succesfully hooked.

    Installation:
    1. Copy eventdetection.smx to the Sourcemod plugins directory (default: <gamedir>/addons/sourcemod/plugins/)
    2. Change the map on your server (or restart the server) to force the plugin to load.

    Usage:


    Just type eventdetect_showall in your client's console (You need to have generic admin access, eg: the "b" flag.).

    Should you want to extend this plugin by adding more eventnames, download the sourcecode (.sp file) below, and add your events to the big array. Don't forget to adjust the EVENT_MAXCOUNT constant to reflect the amount of events present.


    What's included ?


    I've included all the event names, for all mods which i could scrape together from the Sourcemod wiki. I've eliminated dups, which brought it down to a total of 274 unique events. Check the sourcecode for the full list.


    Version history
    • Version 1.0 (initial release)
      • Initial version
      • Tested in Team Fortress 2
    Attached Files
    File Type: sp Get Plugin or Get Source (eventdetection.sp - 765 views - 10.2 KB)
    File Type: smx eventdetection.smx (6.4 KB, 281 views)

    Last edited by Milo|; 02-12-2009 at 02:53.
    Milo| is offline
    recon0
    Veteran Member
    Join Date: Sep 2007
    Location: US
    Old 02-11-2009 , 21:31   Re: [DEV] Event detection
    Reply With Quote #2

    This looks really useful.
    __________________
    recon0 is offline
    Milo|
    Member
    Join Date: Jan 2009
    Location: Netherlands
    Old 02-11-2009 , 23:05   Re: [DEV] Event detection
    Reply With Quote #3

    It's no exceptional plugin, but it's particularly useful for new or relatively unknown mods. There's usually no documentation at all about which events they include and wether or not they actually fire them.

    This plugin is useful for quickly finding that out.

    Also, if you find this plugin useful you might like "net_showevents 2". A command build into TF2 and probably most other orangebox/source games too. It'll dump all properties about events that are fired in your console.

    ps: Added screenshots to the main post, this might make it a bit clearer what exactly the plugin does.

    Last edited by Milo|; 02-11-2009 at 23:18.
    Milo| is offline
    exvel
    SourceMod Donor
    Join Date: Jun 2006
    Location: Russia
    Old 04-05-2009 , 08:22   Re: [DEV] Event detection
    Reply With Quote #4

    Nice plugin but I have a suggestion.
    You can dynamically load available events from the game. For example: in CS:S events are listed in this files:
    Code:
    cstrike\resource\modevents.res
    hl2\resource\gameevents.res
    hl2\resource\serverevents.res
    hl2\resource\hltvevents.res
    I think for other mods files are the same. Your plugin can just read all this events OnPluginLoad. This can be very useful for games which events aren't listed in the SM Wiki page. You can make your plugin to be universal.
    __________________
    For admins: My plugins

    For developers: Colors library
    exvel is offline
    Send a message via ICQ to exvel
    Downtown1
    Veteran Member
    Join Date: Mar 2004
    Old 04-05-2009 , 23:20   Re: [DEV] Event detection
    Reply With Quote #5

    Looks pretty useful, does it tell you when an event has fired and what the event arguments are?
    Downtown1 is offline
    Milo|
    Member
    Join Date: Jan 2009
    Location: Netherlands
    Old 04-06-2009 , 14:20   Re: [DEV] Event detection
    Reply With Quote #6

    Nice idea exvel, if i get around to creating a newer version i'll definitely implement that.

    Downtown1:
    Quote:
    does it tell you when an event has fired
    It does, but it merely shows which event fired, not the values contained in it. You can often use net_showevents for this like i explained in the 3rd post in this thread.
    __________________
    A few small plugins i released for the general public:
    Milo| 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 01:37.


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