AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   set_tr help (https://forums.alliedmods.net/showthread.php?t=19644)

Enigmaya 10-22-2005 06:32

set_tr help
 
use this in "traceline".

but didn't how to use the TraceResult??

{
TR_AllSolid,
TR_StartSolid,
TR_InOpen,
TR_InWater,
TR_flFraction,
TR_vecEndPos,
TR_flPlaneDist,
TR_vecPlaneNormal,
TR_pHit , ----------// only know this
TR_iHitgroup,
};


set_tr(TR_vecEndPos,vec) --------//use right ?

XxAvalanchexX 10-22-2005 19:21

I'm guessing that vecEndPos will be what the TraceLine expects to be the point of collision.

Enigmaya 10-23-2005 03:43

Quote:

Originally Posted by XxAvalanchexX
I'm guessing that vecEndPos will be what the TraceLine expects to be the point of collision.

guess? e... so how to use it ?


PS: thank you. you had answerd me many questions. +karma :D

XxAvalanchexX 10-23-2005 17:02

Let's say you trace a line from x to z.

x-----|----z

Oh no, a wall is in the way! Since the line couldn't trace all the way to z without an obstacle, we return the origin of where it did get to, in this case it would be at |.

It has limited application.

Enigmaya 10-24-2005 00:52

Quote:

Originally Posted by XxAvalanchexX
Let's say you trace a line from x to z.

x-----|----z

Oh no, a wall is in the way! Since the line couldn't trace all the way to z without an obstacle, we return the origin of where it did get to, in this case it would be at |.

It has limited application.

i know.but can i change the end position use set_tr ?

i want to change the Traces where a player is aiming.
this set_tr(TR_pHit,pentToSkip) make users shoot themselves ,
i guess this is change the endpos back to player.
so if i change the position of z, the trace will be changed ?

change this :

x-------z

to:

z
|
|
|
x

XxAvalanchexX 10-24-2005 01:44

TR_pHit is the entity that was hit by the TraceLine. pentToSkip is the entity that should be ignored by the TraceLine. Since the start of the TraceLine is usually a player's origin, if you didn't skip him then it would always return him as hit no matter what since he is standing on top of the start of the line.

I'm not 100% sure, but I don't think vecEndPos is the second origin of the TraceLine, it's just where the collision occurred.

Enigmaya 10-25-2005 01:50

Quote:

Originally Posted by XxAvalanchexX
TR_pHit is the entity that was hit by the TraceLine. pentToSkip is the entity that should be ignored by the TraceLine. Since the start of the TraceLine is usually a player's origin, if you didn't skip him then it would always return him as hit no matter what since he is standing on top of the start of the line.

I'm not 100% sure, but I don't think vecEndPos is the second origin of the TraceLine, it's just where the collision occurred.

o。。。so use set_tr() can't change the second origin of the traceline ?

how to change the traceline? is there another method to do this ?

thank you again.

:P :P


All times are GMT -4. The time now is 23:36.

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