Hooking an event with orpheu
I am hooking bomb (c4) explosion with the one from the csx module. I want to hook it by using orpheu and hooking CGrenade::Explode2() which is the best way I heard. Is someone willing to help me with that?
|
Re: Hooking an event with orpheu
It doesn't matter which module is used to do a particular task as long as there is no major difference in amount of code and/or efficiency. Why do you prefer orpheu? Nothing against the module or anything but you should seek a solution to the problem/question itself without requesting it be with only a single method/format unless there's a valid reason.
|
Re: Hooking an event with orpheu
I heard it can hook it right before the bomb_explode() event from csx, that's why I was aking.
|
Re: Hooking an event with orpheu
But why do you want to do exactly ?
|
Re: Hooking an event with orpheu
This sometime works and sometimes not, that's why I thought it would work perfectly by hooking it with orpheu.
|
Re: Hooking an event with orpheu
bomb_explode() is sent when #Target_Bomb message is detected.
When the bomb timer is finished, CGrenade::Detonate2() (called from CGrenade::C4Think()) calls CGrenade::Explode2(). Inside, it calls CBaseMonster::RadiusDamage(). #Target_Bomb is fired in CHalflifeMultiplay::CheckWinConditions(). So, basically : Timer ends -> Explosion -> Radius damage -> Scoring -> End message. bomb_explode() is called after the damage done, so it can't work using this forward. Without using Orpheu, it could be possible to hook svc_tempentity or ScreenShake but for the most reliable way would be to hook CGrenade::Detonate2() or CGrenade::Explode2(). Using Orpheu, I would use CGrenade::Detonate2(), because this function is exported by default thus giving a symbol name which is more reliable than making a signatures of bytes. So : Code:
and the signature, you need to create a file named "Detonate2" in "orpheu/functions/CGrenade" with this content : Code:
{ |
Re: Hooking an event with orpheu
Works perfectly on linux / windows. I really wonder how you found those things with the values for win and linux :)
and thinking about why there isn't any topic in the tutorials section with a list of made signatures and functions available for orpheu. |
Re: Hooking an event with orpheu
Simply by disassembling the mod binary. For sure, it would be nice to have all the signatures, well, orpheu is still new and coders are not used yet of such module, so it's fine to ask here for the moment. I have to make a tuto how to make a signature, but I'm not motivated right now.
|
Re: Hooking an event with orpheu
Quote:
|
Re: Hooking an event with orpheu
There's an (outdated) tutorial on the wiki: http://wiki.alliedmods.net/Signature..._of_a_Function
|
| All times are GMT -4. The time now is 11:16. |
Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.