Raised This Month: $ Target: $400
 0% 

[TF2] Projectile Collision


Post New Thread Reply   
 
Thread Tools Display Modes
RumbleFrog
Great Tester of Whatever
Join Date: Dec 2016
Location: Fish Tank
Old 04-04-2017 , 00:22   Re: [TF2] Projectile Collision
Reply With Quote #21

Quote:
Originally Posted by Chaosxk View Post
That would increase the model size but not the hitbox/collision if that's what your asking.

This might?
So using that stock and this, in theory it'd just behave like a normal projectile except with bigger hitbox and model to go with it
RumbleFrog is offline
Chaosxk
Veteran Member
Join Date: Aug 2010
Location: Westeros
Old 04-04-2017 , 01:29   Re: [TF2] Projectile Collision
Reply With Quote #22

Maybe? i never used it on rockets. I know it works on boss entities but that's the furthest i ever used it.

You could do something similar to what starsfan did but with SDKHook_Think instead of OnGameFrame. I could write something up if you want.
__________________

Last edited by Chaosxk; 04-04-2017 at 01:30.
Chaosxk is offline
starsfan
BANNED
Join Date: Apr 2017
Location: Texas
Old 04-04-2017 , 14:41   Re: [TF2] Projectile Collision
Reply With Quote #23

Quote:
Originally Posted by Chaosxk View Post
That would increase the model size but not the hitbox/collision if that's what your asking.https://forums.alliedmods.net/images/editor/color.gif

This might?
Trash that first plugin that I posted, it was garbage. I completely re-coded the plugin and made it way more efficient, thanks to Chaosxk's suggestion about using SDKHook_Think. However, I discovered you have to use SDKHook_SetTransmit for projectiles. I also defined a variable to change the explosion sound and visual effect as well as the collision hitbox size to make modifying it easier. I haven't tested this thoroughly yet but it seems to work with no issues. The only thing I can think of is that the explosion occurs on the most recently created projectile entity, meaning that if the collision hitbox value is too big, the explosion won't display in the correct area. Maybe in the future I could put the explosion halfway between the two projectiles when they collide, who knows.

Let me know if you find any problems or want any changes.
Attached Files
File Type: sp Get Plugin or Get Source (projectile_collision.sp - 190 views - 2.9 KB)
File Type: smx projectile_collision.smx (5.3 KB, 102 views)
starsfan is offline
Chaosxk
Veteran Member
Join Date: Aug 2010
Location: Westeros
Old 04-04-2017 , 15:07   Re: [TF2] Projectile Collision
Reply With Quote #24

No need to unhook it OnEntityDestroyed, it already does it automatically.

also if (otherentity == entity) return; should be continue;

otherwise if the first entity is itself then it would always end the function(FindNearbyProjectiles) and not skip to next iteration.

Overall looks a lot better than the old one.
__________________

Last edited by Chaosxk; 04-04-2017 at 15:07.
Chaosxk is offline
starsfan
BANNED
Join Date: Apr 2017
Location: Texas
Old 04-04-2017 , 15:40   Re: [TF2] Projectile Collision
Reply With Quote #25

Quote:
Originally Posted by Chaosxk View Post
No need to unhook it OnEntityDestroyed, it already does it automatically.

also if (otherentity == entity) return; should be continue;

otherwise if the first entity is itself then it would always end the function(FindNearbyProjectiles) and not skip to next iteration.

Overall looks a lot better than the old one.
Thanks, I'll change it after RumbleFrog replies. Also, he asked for another plugin for players to be able to airblast deflect own team projectiles. Do you know if/how to detect or hook the pyro's airblast? The only thing I could figure out was to use GetClientButtons() and check for IN_ATTACK2 but there has to be a better way.
starsfan is offline
starsfan
BANNED
Join Date: Apr 2017
Location: Texas
Old 04-04-2017 , 15:48   Re: [TF2] Projectile Collision
Reply With Quote #26

Quote:
Originally Posted by Chaosxk View Post
No need to unhook it OnEntityDestroyed, it already does it automatically.

also if (otherentity == entity) return; should be continue;

otherwise if the first entity is itself then it would always end the function(FindNearbyProjectiles) and not skip to next iteration.

Overall looks a lot better than the old one.
Updated - I removed OnEntityDestroyed() and ProjectileThink() and changed return to continue.
Attached Files
File Type: sp Get Plugin or Get Source (projectile_collision.sp - 223 views - 2.5 KB)
File Type: smx projectile_collision.smx (5.0 KB, 107 views)
starsfan is offline
RumbleFrog
Great Tester of Whatever
Join Date: Dec 2016
Location: Fish Tank
Old 04-04-2017 , 21:53   Re: [TF2] Projectile Collision
Reply With Quote #27

Thanks, guys, I'll try these when I get time.

Regarding reflecting own team rocket, someone said to set the owner team. But I have yet to test that.
RumbleFrog 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 06:09.


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