AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Plugins (https://forums.alliedmods.net/forumdisplay.php?f=108)
-   -   TF2DECAP: Heads will roll! (Decapitation plugin) (https://forums.alliedmods.net/showthread.php?t=113747)

eee 12-31-2009 18:18

Re: TF2DECAP: Heads will roll! (Decapitation plugin)
 
Quote:

Originally Posted by Antithasys (Post 1036063)
Since you reported and asked the questions I will respond.

You did everything just fine. I will be leaving this plugin in New Plugins for a bit to have others test it and report on it.

Awesome, thank you very much.

Quote:

Originally Posted by Jindo (Post 1036298)
If headshot is customkill 1, why not check that in the damagebits property of the player_death event, and apply the decapitated ragdoll if it matches?

Um, that's kind of what I did, I checked the customkill on player_death. I just meant there aren't hitbox locations passed on the player_death event, only on player_hurt. I could, as I said, prehook player_hurt, I just was under the impression that it would be too much stress on a server doing that so often, especially with tf2 often being resource-heavy. If I'm wrong I can totally change my method to a player_hurt prehook.
I'm also a little confused on what you mean by 'damagebits'. I'm not entirely familiar with the damagebits event int, does it change for every weapon if you hit them in a different hitgroup? If so, even better, I'd love to add that in! I can't seem to find anything explanatory except the definition from modevents ("damagebits" "long" // bits of type of damage).

(please note that if that's how it works, I have no problem with testing every weapon's headshot damagebits when I return, if it hasn't been done already)


Quote:

Originally Posted by noodleboy347 (Post 1036981)
I can confirm that this works great.

Hey, awesome! I'm glad it's working.


I'm going to be away for the new year's holiday, and if there are any more questions I will be glad to answer them when I return.

Jindo 12-31-2009 20:02

Re: TF2DECAP: Heads will roll! (Decapitation plugin)
 
Quote:

Originally Posted by eee (Post 1038395)
Um, that's kind of what I did, I checked the customkill on player_death. I just meant there aren't hitbox locations passed on the player_death event, only on player_hurt. I could, as I said, prehook player_hurt, I just was under the impression that it would be too much stress on a server doing that so often, especially with tf2 often being resource-heavy. If I'm wrong I can totally change my method to a player_hurt prehook.

I'm just unsure why you'd need to hook player_hurt at all when the ragdolls are applied after a player is killed, you can check headshots with customkill in the player_death event so surely you wouldn't need the hitboxes.

Quote:

I'm also a little confused on what you mean by 'damagebits'. I'm not entirely familiar with the damagebits event int, does it change for every weapon if you hit them in a different hitgroup? If so, even better, I'd love to add that in! I can't seem to find anything explanatory except the definition from modevents ("damagebits" "long" // bits of type of damage).
I confused myself there, disregard that. The damagebits are used for detecting things such as fake deaths and dominations, I meant to refer to checking the customkill to see if it matches.

eee 01-01-2010 17:15

Re: TF2DECAP: Heads will roll! (Decapitation plugin)
 
Quote:

Originally Posted by Jindo (Post 1038516)
I'm just unsure why you'd need to hook player_hurt at all when the ragdolls are applied after a player is killed, you can check headshots with customkill in the player_death event so surely you wouldn't need the hitboxes.


I confused myself there, disregard that. The damagebits are used for detecting things such as fake deaths and dominations, I meant to refer to checking the customkill to see if it matches.


Aaaa, I think we're both confused.
Customkill 1 only happens on certain weapon headshots (Ambassador, Huntsman, Sniper Rifle), the ones with a predisposition to cause a critical hit and a damage icon/condition on a headshot. Therefore shooting someone in the head with anything else wouldn't cause a customkill of 1. That's why I'd have to check hitboxes on player_hurt if it were to cause decapitation on any weapon headshot, and that would be rendered very inaccurate with shotguns, but still possible.
(It would be rendered inaccurate with other weapons as well, but those aren't hitscan and I can check for that.)

Of course, as I said, prehooking player_hurt was a concern of mine, which is why I already had it doing as you said, checking customkill 1 on the player_death prehook.
I hope we're on the same page now, and I hope you all had a great New Years!

Jindo 01-01-2010 21:28

Re: TF2DECAP: Heads will roll! (Decapitation plugin)
 
Quote:

Originally Posted by eee (Post 1039373)
Aaaa, I think we're both confused.
Customkill 1 only happens on certain weapon headshots (Ambassador, Huntsman, Sniper Rifle), the ones with a predisposition to cause a critical hit and a damage icon/condition on a headshot. Therefore shooting someone in the head with anything else wouldn't cause a customkill of 1. That's why I'd have to check hitboxes on player_hurt if it were to cause decapitation on any weapon headshot, and that would be rendered very inaccurate with shotguns, but still possible.
(It would be rendered inaccurate with other weapons as well, but those aren't hitscan and I can check for that.)

I see now, so you're trying to have it decapitate when any weapon kills with a headshot, and not just the weapons that are intended to get headshots. I'll see what I can find on the hitboxes; although last time I checked, the player_pinned event (for example) showed me that different classes had different IDs for the same body parts (so a medic's lower left leg could be 14 while a scout's lower left leg may be 23), if there's a way of detecting headshots using the hitboxes it could be messy and impractical.

eee 01-01-2010 22:00

Re: TF2DECAP: Heads will roll! (Decapitation plugin)
 
Quote:

Originally Posted by Jindo (Post 1039628)
I see now, so you're trying to have it decapitate when any weapon kills with a headshot, and not just the weapons that are intended to get headshots. I'll see what I can find on the hitboxes; although last time I checked, the player_pinned event (for example) showed me that different classes had different IDs for the same body parts (so a medic's lower left leg could be 14 while a scout's lower left leg may be 23), if there's a way of detecting headshots using the hitboxes it could be messy and impractical.

Thank you. I already know I can make it decapitate on any weapon's headshot if I use a complicated prehook player_hurt and then check if it would kill them, which is (as you said) pretty messy, but unless I'm mistaken, prehooking player_hurt is a no-no (especially when messing with entities) and slows down servers (especially tf2 servers). The plugin works (so far), I'm just always looking for ways to improve, and if i could somehow get a hitbox location in player_death that'd be grand, but I can't.

Thank you for your help, I hope you find something, I'm certainly looking! :)

Jindo 01-02-2010 05:03

Re: TF2DECAP: Heads will roll! (Decapitation plugin)
 
Well I may have found something, the only issue is that it involves the use of an extension, if that's not a problem for you then here goes:

SDKHooks has a TraceAttack hook which can get the hitbox and hitgroup of the victim, I'll look in to this a little later and see if I can make any use of it.

rig0r 01-02-2010 07:26

Re: TF2DECAP: Heads will roll! (Decapitation plugin)
 
Thank you for this plugin. Works fine, altough the spy seems to drop two hats (and a head :P) when you headshot him. Not sure if that is caused by this plugin though.

eee 01-02-2010 10:24

Re: TF2DECAP: Heads will roll! (Decapitation plugin)
 
Quote:

Originally Posted by Jindo (Post 1039827)
Well I may have found something, the only issue is that it involves the use of an extension, if that's not a problem for you then here goes:

SDKHooks has a TraceAttack hook which can get the hitbox and hitgroup of the victim, I'll look in to this a little later and see if I can make any use of it.

Cool, thank you. I hope it's less resource-hungry than player_hurt, if so I'd be more than glad to implement it.

Quote:

Originally Posted by rig0r (Post 1039916)
Thank you for this plugin. Works fine, altough the spy seems to drop two hats (and a head :P) when you headshot him. Not sure if that is caused by this plugin though.

:shock: Is this only occurring with the spy? If so I'll try to add some kind of check to remove one of the dropped hats (I hope it has properties that show it belongs to the player, m_hOwnerEntity or something).
Thank you for your input, I hope I can resolve this problem.

(I cannot test this myself as I do not have a server and my router doesn't forward ports properly, and of course bots don't have hats).

psychonic 01-02-2010 12:23

Re: TF2DECAP: Heads will roll! (Decapitation plugin)
 
Quote:

Originally Posted by Jindo (Post 1039827)
Well I may have found something, the only issue is that it involves the use of an extension, if that's not a problem for you then here goes:

SDKHooks has a TraceAttack hook which can get the hitbox and hitgroup of the victim, I'll look in to this a little later and see if I can make any use of it.

TF2 does not populate/use the hitbox/hitgroup info.

eee 01-02-2010 14:11

Re: TF2DECAP: Heads will roll! (Decapitation plugin)
 
Quote:

Originally Posted by psychonic (Post 1040173)
TF2 does not populate/use the hitbox/hitgroup info.

Oh. So the way I'm doing it is the only way? I guess that makes me feel better, I just wish there was a way to make any headshot count. Glad you posted, I'd still be worrying about that :)


All times are GMT -4. The time now is 12:05.

Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.