[tf2] hook when physics objects collide?
Im wondering if there is a way to test when a physics object (pipebomb, stickybomb, milk, jarate, etc [it does work with all flairs, but not gaspasser]) hits another?
I am spawning in a model and setting the solidtype to vphysics, It triggers with rockets fine, but no physics objects. I have tried all collision groups, but none work. Any ideas? Code:
} |
Re: [tf2] hook when physics objects collide?
Did you try SDKHook_ShouldCollide ?
Also, may be helpful for you: https://forums.alliedmods.net/showthread.php?t=197815 |
Re: [tf2] hook when physics objects collide?
SDKHook_ShouldCollide seems to use the boundingbox instead of VPhysics, so if the model is concave or rotated, it wont work (unless I am doing something wrong here). I just tested CollisionHook after I made my first post, but it seems its not updated anymore and doesn't work.
|
Re: [tf2] hook when physics objects collide?
And what about SDKHook_Touch instead StartTouch?
What "model" variable = ? Is it a model supporting physics at all? Try prop_physics instead. |
Re: [tf2] hook when physics objects collide?
I have tried SDKHook_Touch, yes. I got CollisionHook working, but it is exactly the same as using SDKHook in this case. The model is custom and it does support physics. I have also tried prop_physics (and override) but its the same.
If you want to check out the model, here it is: https://files.catbox.moe/rx61p6.zip Here are some pics too. https://i.imgur.com/BTzp6HW.png https://i.imgur.com/jGTFIJt.png And here is an example, if I shoot through the corners, it still registers as getting hit. Its like its using the bbox instead of vphysics. https://i.imgur.com/9ZwbOIx.png |
Re: [tf2] hook when physics objects collide?
You can try to use this
https://developer.valvesoftware.com/...lisionProperty CCollisionProperty::SetSurroundingBoundsType( SurroundingBoundsType_t, Vector const*, Vector const*) or this https://developer.valvesoftware.com/wiki/Bounding_box UTIL_SetSize() or CBaseEntity::SetSize() |
Re: [tf2] hook when physics objects collide?
I have gone through all the settings for m_nSurroundType, but its still exactly the same. It either triggers with the bbox/rbox/absbox, or it doesn't trigger at all. Is there maybe a way where I can parent a rocket to the sticky/pipe and still keep the physics of the sticky/pipe?
|
Re: [tf2] hook when physics objects collide?
For collisions between physics objects (including world), you may want to hook CBaseEntity::VPhysicsCollision(int index, gamevcollisionevent_t* event) with DHooks.
The first argument determines which array index represents its own values in the collision event argument (0 or 1). Here's some information about the offsets within the gamevcollisionevent_t struct for TF2, should you need it: Code:
// vphysics_interface.h |
All times are GMT -4. The time now is 00:39. |
Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.