Raised This Month: $ Target: $400
 0% 

TraceLine


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
ts2do
Senior Member
Join Date: Mar 2004
Old 09-21-2004 , 18:27   TraceLine
Reply With Quote #1

could someone help me with traceresult and finding the flFraction
__________________
ts2do is offline
Send a message via AIM to ts2do
Freecode
Never Fall Asleep
Join Date: Jan 2004
Old 09-21-2004 , 22:36  
Reply With Quote #2

i wonder what this is for
Freecode is offline
PM
hello, i am pm
Join Date: Jan 2004
Location: Canalization
Old 09-22-2004 , 09:25  
Reply With Quote #3

as it says in eiface.h:
Code:
float	flFraction;			// time completed, 1.0 = didn't hit anything
You can for example get the distance between the start point end the found point using Length(endPoint - startPoint) * flFraction (although its easier to do it using Length(foundPoint - startPoint) but it was meant to show you what flFraction is).

AFAIK, you can get the flFraction member of the TraceResult structure using:
Code:
new Float:flFraction; traceresult(TR_Fraction, flFraction);
__________________
hello, i am pm
PM is offline
ts2do
Senior Member
Join Date: Mar 2004
Old 09-24-2004 , 23:04  
Reply With Quote #4

and where is TR_Friction taken from, and I also heard about a global trace thing
__________________
ts2do is offline
Send a message via AIM to ts2do
Freecode
Never Fall Asleep
Join Date: Jan 2004
Old 09-25-2004 , 00:00  
Reply With Quote #5

Quote:
Originally Posted by ts2do
and where is TR_Friction taken from, and I also heard about a global trace thing
from fakemeta
so include fakemeta and check fakemeta_const all the way in the bottom.

Its always nice to look at inc's before asking simple questions
Freecode is offline
PM
hello, i am pm
Join Date: Jan 2004
Location: Canalization
Old 09-25-2004 , 04:15  
Reply With Quote #6

Quote:
Originally Posted by ts2do
and where is TR_Friction taken from, and I also heard about a global trace thing
When you do a trace, it automatically stores the results so you can read them using traceresult.
__________________
hello, i am pm
PM is offline
ts2do
Senior Member
Join Date: Mar 2004
Old 09-25-2004 , 14:48  
Reply With Quote #7

does it matter if I use trace_line or engfunc_traceline to trace?
__________________
ts2do is offline
Send a message via AIM to ts2do
Freecode
Never Fall Asleep
Join Date: Jan 2004
Old 09-25-2004 , 14:54  
Reply With Quote #8

hmm trace_line is a forward engfunc_traceline will most likely return just once
Freecode is offline
ts2do
Senior Member
Join Date: Mar 2004
Old 09-25-2004 , 15:03  
Reply With Quote #9

sample snippit plz
__________________
ts2do is offline
Send a message via AIM to ts2do
Freecode
Never Fall Asleep
Join Date: Jan 2004
Old 09-25-2004 , 15:09  
Reply With Quote #10

ok. the TraceLine forward gets called 10 a second if not more. so doing
Code:
register_forward(FM_TraceLine,"TraceLine",1) public TraceLine(Float:v1[3],Float:v2[3],pentToSkip,Mosnters) { //code here }
will constantly get called
but doing

Code:
public traceline(id) { new Float:v1[3] new Float:v2[3] new rid,mosnter eng_func(EngFunc_TraceLine,v1,v2,vid,mosnter); }
will call TraceLine once and gets all the info once only when you will call on public traceline(id). So everytime u need to get stuff from traceline ud have to call traceline(id);

PS. the code is off top of my head so some stuff/natives might be wrong/misspelled
Freecode 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 17:20.


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