Raised This Month: $51 Target: $400
 12% 

[TF2] Huntsman logic on other projectiles


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
TheDarkStar
Junior Member
Join Date: Aug 2020
Old 11-18-2023 , 14:55   [TF2] Huntsman logic on other projectiles
Reply With Quote #1

Is it possible to give other projectiles the same logic as the huntsman?
What I want to do is to give the Crusader's Crossbow headshots. Since it's a projectile weapon I can't just use hitgroup, and I'm fairly new to scripting, so after trying to find anything about this and failing, I'm posting here.
TheDarkStar is offline
XGAK
Junior Member
Join Date: May 2018
Old 11-18-2023 , 22:03   Re: [TF2] Huntsman logic on other projectiles
Reply With Quote #2

I think TrackAttck will work.
XGAK is offline
TheDarkStar
Junior Member
Join Date: Aug 2020
Old 11-18-2023 , 22:16   Re: [TF2] Huntsman logic on other projectiles
Reply With Quote #3

Tried using TraceAttack, the game either doesn't recognize that with projectile weapons or projectile weapons don't use the HitBox or Hitgroup vars. There is an event called arrow_impact, though now I'm running into the issue of "function prototypes do not match", which I don't know how to solve. My code for it is as follows:
Code:
public void OnPluginStart()
{
	HookEvent("arrow_impact", Event_ArrowImpact);
}


public void Event_ArrowImpact(Event event, int attachedEntity, int shooter, int boneIndexAttached, float bonePositionX, float bonePositionY, float bonePositionZ, float boneAnglesX, float boneAnglesY, float boneAnglesZ, int projectileType, bool isCrit)
{
	char[] bone = "";
	IntToString(boneIndexAttached, bone, 1)
	PrintToServer(john);
}
TheDarkStar is offline
XGAK
Junior Member
Join Date: May 2018
Old 11-18-2023 , 22:37   Re: [TF2] Huntsman logic on other projectiles
Reply With Quote #4

I forget that arrows dont fire TraceAttack.
You can try Detour CTFProjectile_Arrow::CanHeadshot().
Found this https://github.com/KohtepSP/TF2-Crossbow-Headshots
Maybe the signature need be updated.

Last edited by XGAK; 11-18-2023 at 23:31. Reason: ...
XGAK is offline
Reply



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 03:27.


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