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

Knife Distance by SchlumPF


Post New Thread Reply   
 
Thread Tools Display Modes
SchlumPF*
Veteran Member
Join Date: Mar 2007
Old 05-12-2009 , 16:50   Re: Knife Distance by SchlumPF
Reply With Quote #21

Quote:
Originally Posted by DeepBlueSea View Post
This way you are catching a trace that doesn't necessarily have anything to do with the real hit-trace.

This would be the failed TraceLine Call you are getting, when in reality already TraceHull is used.
This way you are catching a trace that doesn't necessarily have anything to do with the real hit-trace.
ofc distance == range emans that...

Quote:
Originally Posted by DeepBlueSea View Post
This would be the failed TraceLine Call you are getting, when in reality already TraceHull is used.

All you need is FakeMeta (hook TraceLine and TraceHull) and filter out all non related traces. It's pretty easy actually. You can look at every single trace and just have to think about all criterias that the trace has to match to filter the right ones out.
lol, didnt even know about that forwards (rarly used traces so far) xD thx
__________________

Last edited by SchlumPF*; 05-12-2009 at 16:52.
SchlumPF* is offline
Send a message via ICQ to SchlumPF*
DeepBlueSea
Junior Member
Join Date: Jul 2007
Old 05-13-2009 , 13:45   Re: Knife Distance by SchlumPF
Reply With Quote #22

I already gave this tipp over PM. Just for thread completeness.

arkshine was close.
Quote:
Originally Posted by arkshine View Post
You can remove FindHullIntersection() too.
It's what I was meant.
Correct. FindHullIntersection() gets only called against world hits. Why?
Look here [1].
Getting the last trace results won't quite cut it though. Unrelated traces are conducted almost every time in between.
You have to hook TraceLine and TraceHull to filter them out.

Here is the commented HexRays Pseudo-Code for the Slash-function:
[1] http://home.arcor.de/neotracer/sub_10009230.html
DeepBlueSea is offline
Arkshine
AMX Mod X Plugin Approver
Join Date: Oct 2005
Old 05-14-2009 , 06:18   Re: Knife Distance by SchlumPF
Reply With Quote #23

@DeepBlueSea:

What I don't understand is, whatever tracehull/traceline, the last trace result is saved in the same var (tr) at the end and TraceAttack() is used right after with this trace result ( The knife attack is based on the crowbar in the HLSDK, actually it would be exactly the same code ), why hooking TraceAttack() and getting end position from the trace is not enough ? I'm not convinced ( or I don't understand the SchlumPF*'s explanations above )
Arkshine is offline
DeepBlueSea
Junior Member
Join Date: Jul 2007
Old 05-14-2009 , 07:34   Re: Knife Distance by SchlumPF
Reply With Quote #24

Come to think of it...
Yes, this should work, too. But it necessarily has to be a Pre-Hook of TraceAttack. Because TraceAttack conducts several unrelated traces (blood calculation).
A simple test (vecEnd-vecSrc == 48.0) could confirm this.
Personally i am not really a fan of wrapping virtual class-functions. They could be broken very easily after an update.

Quote:
( The knife attack is based on the crowbar in the HLSDK, actually it would be exactly the same code )
I got accustomed to DIRECTLY look at the disassembly every time. Because it sometimes saves yourself much time of error searching...
DeepBlueSea is offline
Arkshine
AMX Mod X Plugin Approver
Join Date: Oct 2005
Old 05-14-2009 , 08:20   Re: Knife Distance by SchlumPF
Reply With Quote #25

About the blood calculation, having a look in the HLSDK, the trace result is saved in another var, so I don't think it does matter here.
I understand that it could be broken after an update, but it would be a lot more efficient to use it against FM_TraceLine/TraceHull + filter. But it would be interesting to see this method too.

Quote:
I got accustomed to DIRECTLY look at the disassembly every time. Because it sometimes saves yourself much time of error searching...
I agree. I'm jealous you can do that easily. I'm playing with IDA and HexRays Decompiler, but it's hard for me to understand well. :p

Anyway thanks for your answer.
Arkshine is offline
SchlumPF*
Veteran Member
Join Date: Mar 2007
Old 05-14-2009 , 10:32   Re: Knife Distance by SchlumPF
Reply With Quote #26

Quote:
Originally Posted by arkshine View Post
@DeepBlueSea:

What I don't understand is, whatever tracehull/traceline, the last trace result is saved in the same var (tr) at the end and TraceAttack() is used right after with this trace result ( The knife attack is based on the crowbar in the HLSDK, actually it would be exactly the same code ), why hooking TraceAttack() and getting end position from the trace is not enough ? I'm not convinced ( or I don't understand the SchlumPF*'s explanations above )
ill add a link to a good explanation of dbs in the mainpost, just got a small issues i have to fix until i attack a new version using a better code.
__________________
SchlumPF* is offline
Send a message via ICQ to SchlumPF*
DeepBlueSea
Junior Member
Join Date: Jul 2007
Old 05-14-2009 , 12:29   Re: Knife Distance by SchlumPF
Reply With Quote #27

Quote:
Originally Posted by arkshine View Post
About the blood calculation, having a look in the HLSDK, the trace result is saved in another var, so I don't think it does matter here.
Well then i misunderstood global_get(). Does it return the last trace of a global scope, or does it return the last trace of a local function scope?
If on a global scope its matters, if not it doesn't.

Quote:
Originally Posted by arkshine View Post
I understand that it could be broken after an update, but it would be a lot more efficient to use it against FM_TraceLine/TraceHull + filter. But it would be interesting to see this method too.
I like this, because it's directly on the spot. It's where the "shit" happens, and here are the best potentials if you want to actually manipulate a trace or whatnot allowing easy functionality expanding of your plugin.
Of course this means some kind of performance impact. It would be interesting to know though, what the performance impact difference is.

Quote:
Originally Posted by arkshine View Post
I agree. I'm jealous you can do that easily. I'm playing with IDA and HexRays Decompiler, but it's hard for me to understand well. :p

Anyway thanks for your answer.
Well i am coming from the ClientHook Area...call me a hacker. So I naturally depend on nothing else but the disassembly. :/
DeepBlueSea is offline
Arkshine
AMX Mod X Plugin Approver
Join Date: Oct 2005
Old 05-14-2009 , 13:32   Re: Knife Distance by SchlumPF
Reply With Quote #28

Quote:
Well then i misunderstood global_get(). Does it return the last trace of a global scope, or does it return the last trace of a local function scope?
If on a global scope its matters, if not it doesn't.
The first but I was meant this :

In TraceAttack :

Code:
void CBasePlayer :: TraceAttack( entvars_t *pevAttacker, float flDamage, Vector vecDir, TraceResult *ptr, int bitsDamageType) {     if ( pev->takedamage )     {         [...]         TraceBleed( flDamage, vecDir, ptr, bitsDamageType );     } }

ptr is passed into TraceBleed, right. But ptr is not modified. The next TraceLine uses another vars.

Code:
void CBaseEntity :: TraceBleed( float flDamage, Vector vecDir, TraceResult *ptr, int bitsDamageType ) {     // make blood decal on the wall!     TraceResult Bloodtr;     [...]     for ( i = 0 ; i < cCount ; i++ )     {         [...]         UTIL_TraceLine( ptr->vecEndPos, ptr->vecEndPos + vecTraceDir * -172, ignore_monsters, ENT(pev), &Bloodtr);         if ( Bloodtr.flFraction != 1.0 )         {             UTIL_BloodDecalTrace( &Bloodtr, BloodColor() );         }     } }

So, the original trace from TraceLine or TraceHull passed into TraceAttack() is not modified. So hooking TraceAttack() and using the trace result passed should be good.
Arkshine is offline
SchlumPF*
Veteran Member
Join Date: Mar 2007
Old 05-14-2009 , 13:50   Re: Knife Distance by SchlumPF
Reply With Quote #29

i work simultanious on both versions (hooking FM_TraceLine + FM_TraceHull and hooking TraceAttack).
i prefer to release the TraceAttack version since it runs less code and is ofc faster, what would you prefer?
__________________
SchlumPF* is offline
Send a message via ICQ to SchlumPF*
Arkshine
AMX Mod X Plugin Approver
Join Date: Oct 2005
Old 05-14-2009 , 13:59   Re: Knife Distance by SchlumPF
Reply With Quote #30

I would prefer TraceAttack() version. ^^
Arkshine 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 13:42.


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