PDA

View Full Version : [TF2] Fire huntsman in the air


pheadxdll
09-05-2010, 23:17
This extension is now a plugin. Go get it here (https://forums.alliedmods.net/showthread.php?t=240497).

I felt that the huntsman was under-powered and needed a boost so I wrote this extension to allow snipers to shoot the bow-and-arrow while airborne.

http://teklinks.org/images/huntsmans.png (http://teklinks.org/images/huntsmanbig.png)


I always felt it was awkward to prime the bow in mid-air and not be able to release until you touch the ground. Snipers can't defend themself if they get airblasted by a pyro or get tossed by a rocket. Things like noclip and low grav make this useful to have anyway.

Usage:
Plugin is autonomous, it's always on until you unload it.

Convars:
huntsman_version - Displays the current version

Change log:

0.1.1 - Public release!
0.1.2 - Fixed linux version!
0.1.2 - Fixed for the linux binary for the 4/14 update!
Notes:
This patches memory so it's efficient and there's no problems with client prediction. It's been tested on windows and linux. You still can't shoot arrows while in water. That is restricted by a check on the client, so don't ask me to do that.

I had fun making this, let me know if you use it. :up:

Seta00
09-05-2010, 23:20
needs more anti-aliasing

btw nice module, huntsman gets even better with this

Wazz
09-14-2010, 19:05
I would suggest checking the bytes you are about to patch over in case they are changed after an update. Splicing code will be an insta-crash.

pheadxdll
09-14-2010, 20:27
I would suggest checking the bytes you are about to patch over in case they are changed after an update. Splicing code will be an insta-crash.

Since the bytes I patch are not wild carded in the signature, I don't think that'll be a problem. :grrr:

Wazz
09-14-2010, 21:33
That's true!

badwolf
11-06-2010, 17:50
sm exts list

...gives:

[SM] Extension huntsman.ext.2.ep2v.so failed to load: Could not locate signature to apply patch.

codydbgt
11-13-2010, 23:09
same here :(

pheadxdll
11-14-2010, 21:03
Hey guys, try the new version and let me know if it fixes it, I haven't gotten a chance to test it.

sejin513
11-16-2010, 12:18
it works but there is no shooting sounds.

btw, nice work!

pheadxdll
11-17-2010, 10:28
Yup, your client plays that sound, it doesn't expect you to shoot in the air, so it doesn't play. You got the linux version to work?

sejin513
11-17-2010, 23:30
Sorry, Windows D;

SuperShadow
04-15-2011, 20:19
After the 4/14/11 TF2 update I got this when doing sm exts list:
[03] <FAILED> file "huntsman.ext.2.ep2v.so": /usr/local/games/tf/887756/68.232.171.204:27015/orangebox/tf/addons/sourcemod/extensions/huntsman.ext.2.ep2v.so: undefined symbol: _Unwind_Resume

Pretty much the same in console:
L 04/15/2011 - 19:13:17: [SM] Unable to load extension "huntsman.ext": /usr/local/games/tf/887756/68.232.171.204:27015/orangebox/tf/addons/sourcemod/extensions/huntsman.ext.2.ep2v.so: undefined symbol: _Unwind_Resume


I have some players that think that the ability to shoot as a sniper while in the air should be built into the game. They would really appreciate if you can get an update out.

pheadxdll
04-15-2011, 22:33
I have some players that think that the ability to shoot as a sniper while in the air should be built into the game. They would really appreciate if you can get an update out.

:) It should become part of the game IMO, glad to see this getting used. I fixed the linux binary, let me know if you run into anything.

SuperShadow
04-15-2011, 23:44
Thanks for the update pheadxdll I've put it on the server. I'll let you know how it works out.

Ginxeng
04-16-2011, 02:00
:) It should become part of the game IMO, glad to see this getting used. I fixed the linux binary, let me know if you run into anything.It used to be part of the huntsman before the nerf.

Unreal1
04-16-2011, 09:33
Thnks for the fix!

SuperShadow
10-14-2011, 11:10
The recent updates has this is failing again, my players miss shooting while in the air.

pheadxdll
10-14-2011, 16:45
It's hard to go back :)

Update broke just linux. Grab the new gamedata and restart your server. I attached it below or you can get it from the latest version.

SuperShadow
10-15-2011, 11:02
Yep, Linux is what I'm running on. Thanks pheadxdll!

Static2601
06-04-2012, 18:30
I've installed and ran this on my server for the first time and the first thing i noticed was that you don't have to charge the bow, it's full strength right away. That's something I just don't like. The arrows can be shot in midair just fine. I hope you can fix this. I don't know anything about writing extentions, but maybe a plugin could be written to fix this. thanks.

---update---
Hmm, after unloading the extention, the bow seems to fire the same as if the extention was loaded, maybe it fires fine, I havent used the bow in a while. Is there anyhting different about the bow then the stock bow? I've reloaded it for now.

pheadxdll
06-05-2012, 18:43
That does not happen on my server. The fact that you unloaded it and the problem still presists has me thinking that you have another plugin or mod causing the issue. Charge works like normal over here. :)

Static2601
06-10-2012, 22:04
That does not happen on my server. The fact that you unloaded it and the problem still presists has me thinking that you have another plugin or mod causing the issue. Charge works like normal over here. :)
Yeah sorry, it works fine. I just used it for 5 minutes and thought it wasnt working the same, i didnt realize that at first. Great addition to my server. I was looking for a way do this for a while. Thanks

PolyQuad
08-20-2012, 12:35
I just added this to my server this morning, thanks! :)

pheadxdll
10-27-2012, 13:56
Fixed for yesterday's update, only linux was affected. Grab it from the first post.

Helvetica
10-27-2012, 16:47
Fixed for yesterday's update, only linux was affected. Grab it from the first post.

Thanks for updating this, I have been running this extension for over a year and cannot imagine my server without it.

Scipizoa
06-02-2013, 10:38
Just gonna chime in here, its june 2nd 2013 and it works flawlessly on my two linux servers. ;)

Powerlord
03-07-2014, 15:58
This extension isn't compiling against HL2SDK-TF2, SourceMod 1.5 and MetaMod: Source 1.10 on Linux.

The exact error is:
In file included from ../../hl2sdks/hl2sdk-tf2/public/tier1/utlvector.h:23:0,
from ../../hl2sdks/hl2sdk-tf2/public/tier1/convar.h:21,
from ../../hl2sdks/hl2sdk-tf2/public/eiface.h:16,
from ../../mmsource-1.10/core/ISmmAPI.h:46,
from ../../mmsource-1.10/core/ISmmPlugin.h:39,
from sdk/smsdk_ext.h:96,
from sdk/smsdk_ext.cpp:34:
../../hl2sdks/hl2sdk-tf2/public/tier1/utlmemory.h: In function ‘void* MemAlloc_AllocAligned(size_t, size_t)’:
../../hl2sdks/hl2sdk-tf2/public/tier1/utlmemory.h:41:14: error: redefinition of ‘void* MemAlloc_AllocAligned(size_t, size_t)’
../../hl2sdks/hl2sdk-tf2/public/tier0/memalloc.h:120:14: error: ‘void* MemAlloc_AllocAligned(size_t, size_t)’ previously defined here
make[1]: *** [Release.orangeboxvalve/sdk/smsdk_ext.o] Error 1
make[1]: Leaving directory `/home/tf2/dev/sourcemod-extensions/huntsman-src'
make: *** [all] Error 2It compiles fine on Windows, though.

(Note: Fixing the library extension from .so to _lib.so doesn't fix it either)

I may try updating the files with the newer Makefile from the Sample Extension Project and see if there's something different in there that fixes things, seeing as how this Makefile is from SM 1.3.

Edit: Yes, using this Makefile allows it to compile if you specify ENGINE=tf2 (producing huntsman.ext.2.tf2.so), but I haven't tested it yet. The only major difference I can tell is that sourcemod and its public directory are included first in the sample ext files, like they are in the SM AMBuild files.

Powerlord
03-07-2014, 16:51
Anyway, the reason that I wanted a working Makefile for this is because I wanted to add an enable cvar to it. As far as I can tell this works, but I haven't been at a computer with TF2 on it to actually test it (but it's running on my test server now). I modified the Makefile in the src zip to default to ENGINE=tf2.

The cvar? huntsman_enabled, which for compatibility reasons defaults to 1.

Setting it to 0 will make it unload the memory patch. Setting it to 1 makes it load the memory patch again.

This change was done to help integrate it into multi-mod servers where you want the Huntsman to be able to be fired in the air in some game modes (i.e. Huntsman Hell), but not on other game modes (standard, etc...).

Warning to people using the previous versions: The filenames changed in this version. As far as I know, SourceMod will have a preference for this version (huntsman.ext.2.tf2.*) over the old versions (huntsman.ext.2.ep2v.*) but I can't guarantee that. To be on the safe side, move the old version to disabled/ (doesn't exist by default) or delete it.

Oshizu
03-07-2014, 17:17
So this extension finds player's jump offset and patches huntsman block related part in func with null value?
Am i correct?

Powerlord
03-07-2014, 19:23
So this extension finds player's jump offset and patches huntsman block related part in func with null value?
Am i correct?

Something like that... pheadxdll would have to tell you for sure.

I know it currently works on Linux, but I haven't tested it on Windows. Incidentally, this means that yes, the cvar works on Linux. \o/

pheadxdll
03-07-2014, 21:04
This patches the check if you are on the ground inside the function that calculates when you can release the bow. I just haven't had occasion to change the Makefile for awhile. I was waiting for the gamedata to break to move this extension to a plugin. (Like I did with the thriller extension) When I do that, I'll add a CVAR to turn the functionality on and off.

friagram
05-15-2014, 23:00
Windows needs gamedata

pheadxdll
05-16-2014, 18:58
This extension has been ported to a plugin. Get the plugin here (https://forums.alliedmods.net/showthread.php?t=240497) for the gamedata fix.

As a bonus, I said I would add that cvar huntsman_enabled to the plugin, so you can now toggle shooting the huntsman in the air without unload/reloading.