CollisionHook
HEY READ THIS (MARCH 2024)
The notice below still holds. I don't personally use this extension, but contributions on GitHub are welcome. HEY READ THIS (DEC 2014) I know you probably really want to use this extension, but here's the fine print: it's now completely unsupported by myself. If you need gamedata updates you're on your own. This extension should be a last resort when you have exhausted all other options for managing collisions: m_nSolidType, m_CollisionGroup, etc This extension provides a straightforward and easy way to hook and modify collision rules between entities. You might say "but sdkhooks provides this functionality already!", and you would be partly right. However, I wasn't happy with how sdkhooks ShouldCollide works, and here's why: If you're familiar with sdkhooks, this code won't be new: PHP Code:
To solve this limitation, I wrote CollisionHook. CollisionHook provides 2 forwards to plugins, both of which can modify the collision rules of certain types of collisions. PHP Code:
PHP Code:
To modify the behavior of the collision check, simply set result to true if you wish for the entities to collide; otherwise false, and return Plugin_Handled or Plugin_Stop in the forward. If you want the game to use default collision rules, simply return Plugin_Continue in the forward. The benefits of both of these forwards is that you can strictly control which entities can collide, instead of just a specific type of entity. Installation
Source The source code is available here. Limitations / Known Issues / Notes
Thanks
|
Re: CollisionHook
This is a neat idea! I tried something like this myself a while ago and ran into a few issues with a PassServerEntityFilter detour.
Using this code for example: PHP Code:
Normally it would prevent trace weapons from hitting any player target, because the player firing is passed as pPass. So in order to differentiate player collision traces from the rest, I detoured CTraceFilterSimple::ShouldHitEntity instead which provided collisionGroup and contentsMask. Mine ended up looking like this: (unreleased because I thought it was an ugly workaround) Code:
DETOUR_DECL_MEMBER2(ShouldHitEntity, bool, IHandleEntity *, pHandleEntity, int, contentsMask) |
Re: CollisionHook
Quote:
I haven't tested CS:S so I'm not sure why that would crash, but I'll check it out and see if anything can be salvaged. Quote:
Also I'd make the assumption that most mods won't be touching CTraceFilterSimple, so the offsets to the members would likely be safe to get at. |
Re: CollisionHook
Quote:
I haven't had a chance to play around with the vphysics stuff yet but it looks pretty cool too! |
Re: CollisionHook
psychonic has been kind enough to update the extension for the linux changes that broke things a while back. You can get it here.
|
Re: CollisionHook
Wanted to make a new plugin.
No success :( PHP Code:
SM 1.4.7 & MM:S 1.9.0. |
Re: CollisionHook
Quote:
That being said, I haven't yet investigated the CS:S crashes mentioned in the previous posts. As this extension was originally designed for TF2, your mileage may vary. |
Re: CollisionHook
Quote:
PHP Code:
I'll try to find the correct signature. |
Re: CollisionHook
Does this still work? Or is there a better way to do this by now?
|
Re: CollisionHook
It works perfectly fine! There is no other way to do what this does.
|
Re: CollisionHook
Quote:
|
Re: CollisionHook
Quote:
|
Re: CollisionHook
but still crashing
|
Re: CollisionHook
Are you compiling from source?
|
Re: CollisionHook
Works on cs:s but get random crashs...
Code:
#include <sourcemod> |
Re: CollisionHook
Quote:
Quote:
|
Re: CollisionHook
As is probably evident by now, you need to build from source if you want a working version in CS:S. The latest version on the downloads page (0.1) has a crash issue.
I'd build it myself and upload it, but I've been swamped with class work. |
Re: CollisionHook
I use the version available on the download page ; i'll try to compile from source...
|
Re: CollisionHook
Quote:
|
Re: CollisionHook
Quote:
|
Re: CollisionHook
Quote:
|
Re: CollisionHook
I've uploaded built versions of 0.2. You can grab it off the downloads page.
Thanks to KyleS for the linux build. |
Re: CollisionHook
Working and doesn't seem to crash anymore...
Good job! |
Re: CollisionHook
Good job at fixing crashing!
Noblock isn't smooth like I thought it going to be. |
Re: CollisionHook
Quote:
|
Re: CollisionHook
Quote:
|
Re: CollisionHook
Does this work fine without crash?
I need a function like that to prevent a stuck problem on my saxton hale server. Thanks! |
Re: CollisionHook
Quote:
In your case, you can likely solve your problem in a more ideal way: collision groups, solid type, etc. |
Re: CollisionHook
It's broken.
Code:
L 05/17/2014 - 16:40:07: [CLHOOK] Sigscan for PassServerEntityFilter failed - Disabling detour to prevent crashes |
Re: CollisionHook
Code:
L 06/27/2014 - 20:52:03: SourceMod error session started |
Re: CollisionHook
Hey,
I get the following error on CS:GO. [SM] Extension collisionhook.ext.dll failed to load: The specified procedure could not be found. Is this an outdated gamedata file issue? |
Re: CollisionHook
Wow what a bummer ,
This was a useful ext.. yet this doesnt surprise me anymore , seems like support for many useful plugins is on the down swing these days and you can wait weeks to years to get a reply and there are many good coders out there who could but just dont want to take the time :cry: Really sad |
Re: CollisionHook
Thank you! I hope it's working!
|
Re: CollisionHook
skResolver,
Well you can hope but no its not working anymore unless some one fixed it and didnt release it to anyone it no longer works ... I was using this for a good noblock someone made . |
Re: CollisionHook
Does anyone have this working with new signatures ?
I even tried to PM VoiDeD with no answer so I take it this is a dead extension . I really need a working noblock for our servers and not one of them work , tested them all and no deal :down: |
Re: CollisionHook
https://forums.alliedmods.net/showthread.php?p=462813
I ended up using this. Works as expected for csgo |
Re: CollisionHook
Thank you Neuro Toxin for trying to help but this one does cause the mayhem bug in HL2dm..
and once it does you have to restart the server to get rid of it . Only Voided's hook ext will do it correctly . also sendproxy works but you cant team it and the bots will run into you attacking while inside you making it hard to kill them . |
Re: CollisionHook
:(
|
Re: CollisionHook
Well since not enough users have a need for this I dont think we will ever see this ext updated ...
I was hoping someone who had experience in either recompile or signatures would have been nice enough to fix it but nothing :cry: |
Re: CollisionHook
Still Hoping ,
All things are possible . Maybe one day some one will be kind enough to repair this and some other great plugins that have been killed off or damaged thanks to Valve :crab: |
All times are GMT -4. The time now is 20:41. |
Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.