AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Code Snippets/Tutorials (https://forums.alliedmods.net/forumdisplay.php?f=83)
-   -   [Info] About bullet/particle power change (https://forums.alliedmods.net/showthread.php?t=49715)

VEN 01-11-2007 14:49

[Info] About bullet/particle power change
 
Note #1: This information probably will not make much sence if you unfamiliar with the trace scripting.

I found the way to change a bullet/particle power directly through fraction traceresult. The problem is that the [power | fraction] dependence are nonlinear.

This is a table for AWP TA leg damage:
Code:

F          D 
---------------
 0.0        30
 0.1        29
 0.3        28
 0.5        27
 0.7        26
 0.9        25
 1.1        24
 1.4        23
 1.7        22
 2.0        21
 2.3        20
 2.6        19
 2.8        18
 3.2        17
 3.5        16
 3.9        15
 4.2        14
 4.6        13
 5.1        12
 5.6        11
 6.2        10
 6.6        9
 7.3        8
 8.0        7
 8.9        6
 9.8        5
10.7        4
12.0        3
13.8        2
16.2        1
20.4        0

Note #2: For fraction in range {0.0 ... ~5.0} the dependence are nearly linear.

Note #3: Also you can use a negative fraction values to increase power.

Cheap_Suit 01-28-2007 06:19

Re: [Info] About bullet/particle power change
 
This is very interesting. Are the fractions in the table the same with other weapons?

VEN 01-29-2007 07:01

Re: [Info] About bullet/particle power change
 
what?

Cheap_Suit 01-29-2007 12:31

Re: [Info] About bullet/particle power change
 
The TR_flFraction value.

This is what im trying to do. Block the damage but still have the effect of getting shot.
Quote:

new hitplace = get_tr(TR_iHitgroup)
if(hitplace == HIT_CHEST || hitplace == HIT_STOMACH)
{
set_tr(TR_flFraction, 30.0)
}
Because using 1.0 it seems like you didnt even get hit.

Zenith77 01-29-2007 15:03

Re: [Info] About bullet/particle power change
 
Quick question, what is TR_flFraction (and the other stuff for that matter). I haven't had much experience with trace_line() and would appreciate a quick explanation ;).

VEN 01-30-2007 08:01

Re: [Info] About bullet/particle power change
 
It's a trace result data member. Probably represents a tracing time in some units. To reproduce hit effect without any damage you can set it to high value for example to 100.0.

Zenith77 01-30-2007 13:30

Re: [Info] About bullet/particle power change
 
I was kind of asking for specifics, I know what it general is :p. Thanks anyway.

XxAvalanchexX 01-30-2007 18:48

Re: [Info] About bullet/particle power change
 
http://www.thewavelength.net/forums/...ds/000775.html

Quote:

Originally Posted by botman
flFraction is a variable within this TraceResult structure that tells you how far the trace went before it hit something. For example if you are tracing between 2 points that are 100 units apart and TraceLine returns with flFraction = 0.75 then you know that 3/4 of the way from the start point to the end point something was in the way.

So, the reason that all TraceLine codes assume that you didn't hit anything if flFraction is 1.0, is because that means that the trace made it 100% of the way before hitting anything (aka, it never hit anything).

Zenith77 01-30-2007 21:52

Re: [Info] About bullet/particle power change
 
Thanks.


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

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