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-29-2009 19:24

TF2DECAP: Heads will roll! (Decapitation plugin)
 
1 Attachment(s)
I don't know about you, but the first thing I wanted to do when I saw the Eyelander was decapitate things. No, I'm not a ghost, but I do have a penchant for removing heads. So I thought, you know what this game needs? Even more decapitations!

Note:
Most of this plugin was directly... borrowed... from TF2Gore v2 (the gib part), so MAJOR credit goes to Joe 'Pinkfairie' Maley http://forums.alliedmods.net/showthread.php?p=666087, if not for his work, this plugin would be looking a bit silly.


Description:

This plugin causes decapitations on headshots with any weapon able to headshot. It doesn't make a mess of logging, or your pots and pans, as it only creates a ragdoll.

Convars:


tf2decap_decap_always (default 0): Every kill is a decapitation. Gets a little wacky. Overrides huntsman setting.

tf2decap_decapitations (default 1): Allows the plugin to take over and turn headshots into decapitations.

tf2decap_decap_huntsman (default 1): The huntsman follows normal headshot rules (customkill 1), so the headshots will trigger a decapitation. If you don't like seeing a head rolling away from a neck with an arrow in it, change this to 0. This will decapitate regardless if tf2decap_decap_always is 1.


Development Notes:

This plugin prehooks player_death. Not as bad as some plugins, but if you're worried about that sort of thing, there you have it.
I've also left some room right at the start (DecapTypes, an array of customkill types to allow a decapitation, and a DecapTypeCount that follows it). It looks useless now with one type, but I felt it should be there for easy modifications.




Other notes:
If this isn't approved, I wouldn't mind if someone decides to make it better/fix whatever I did wrong because I kind of thought it was a good idea. I'm pretty sure I probably did something wrong (first submission), so as per the rules I'll be reporting my post.

voogru 12-29-2009 19:49

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

public Plugin:myinfo =
{

        name = "Team Headless 2",
        author = "some fag & Pinkfairie (unknowingly)",
        description = "Decapitations",
        version = "1.0",
        url = "Ants"
}

Really? I'm not an approver but this is a little silly.

eee 12-29-2009 19:50

Re: TF2DECAP: Heads will roll! (Decapitation plugin)
 
Well alright, I've changed that, but how did you want me to put his name in there?

voogru 12-29-2009 20:16

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

Originally Posted by eee (Post 1035886)
Well alright, I've changed that, but how did you want me to put his name in there?

There are much better ways to put the names in the author tag than "Some fag".

Also, this is just a pet-peeve and maybe you're still learning, but usually this is also considered a little silly:

Take note I am just nit-picking here. So don't take offense.

Code:

//Loop:
                        for(new X = 0; X < DecapTypeCount; X++)
                        {

                                //Compare:
                                if(ck == DecapTypes[X] || (ak == 1))
                                {
       
                                        //Declare:
                                        decl Ent;
 
                                        ...
                                }
                        }

Most programmers (even a novice) will know what those do, so it's meaningless to add self-explanatory comments. Generally you should comment code when it does something that is not immediately understandable. It's just a suggestion.

:)

eee 12-29-2009 20:52

Re: TF2DECAP: Heads will roll! (Decapitation plugin)
 
Useless comments stripped, thank you.

noodleboy347 12-29-2009 21:06

Re: TF2DECAP: Heads will roll! (Decapitation plugin)
 
Pretty cool, are you able to make every weapon headshot work, or does Valve only record headshots with the Rifle/Huntsman/Ambassador?

eee 12-29-2009 21:28

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

Originally Posted by noodleboy347 (Post 1035977)
Pretty cool, are you able to make every weapon headshot work, or does Valve only record headshots with the Rifle/Huntsman/Ambassador?

Only those kills are customkill 1. Unfortunately, while player_hurt checks hitboxes, player_death does not. I was trying to not prehook player_hurt because I'm told that slows down servers quite a lot. If anyone can tell me an accurate way to check the hitbox on death, or a smart way to pass it from player_hurt without using too much resources (because i assume marking each player every time they're hurt would cause the server to slow), I'd be happy to make that another condition to decapitate.

If I'm completely wrong about prehooking player_hurt and whatnot, please tell me, I'll do that.

Antithasys 12-29-2009 23:15

Re: TF2DECAP: Heads will roll! (Decapitation plugin)
 
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.

Jindo 12-30-2009 07:10

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

Originally Posted by eee (Post 1035994)
If I'm completely wrong about prehooking player_hurt and whatnot, please tell me, I'll do that.

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?

noodleboy347 12-30-2009 17:49

Re: TF2DECAP: Heads will roll! (Decapitation plugin)
 
I can confirm that this works great.


All times are GMT -4. The time now is 10:33.

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