Raised This Month: $ Target: $400
 0% 

Using trace_line


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Charr
Senior Member
Join Date: Jul 2005
Location: Long Island, New York, U
Old 10-26-2005 , 15:28   Using trace_line
Reply With Quote #1

I'm trying to use trace_line to find if it hits an entity/map texture.

What does it return if it hits nothing or a map texture?
Charr is offline
Send a message via AIM to Charr Send a message via MSN to Charr
XxAvalanchexX
Veteran Member
Join Date: Oct 2004
Location: abort73.com
Old 10-26-2005 , 17:22  
Reply With Quote #2

pHit would probably be 0, and I assume that flFraction would be 1.0
__________________
No longer around. Thanks your support, everyone! As always:
THIS ONES FOR YOU
3000 PTS
XxAvalanchexX is offline
Charr
Senior Member
Join Date: Jul 2005
Location: Long Island, New York, U
Old 10-26-2005 , 22:50  
Reply With Quote #3

So I would have to use the trace_line, then the result?

I checked out the trace result on the funcwiki, but
Code:
 traceresult ( type, [ ... ] )
Isn't too discriptive.
Charr is offline
Send a message via AIM to Charr Send a message via MSN to Charr
XxAvalanchexX
Veteran Member
Join Date: Oct 2004
Location: abort73.com
Old 10-26-2005 , 23:05  
Reply With Quote #4

Hmm, try this:

Code:
trace_line(...); new pHit = traceresult(TR_pHit);
__________________
No longer around. Thanks your support, everyone! As always:
THIS ONES FOR YOU
3000 PTS
XxAvalanchexX is offline
Charr
Senior Member
Join Date: Jul 2005
Location: Long Island, New York, U
Old 10-26-2005 , 23:06  
Reply With Quote #5

Will do and thanks.
Charr is offline
Send a message via AIM to Charr Send a message via MSN to Charr
Charr
Senior Member
Join Date: Jul 2005
Location: Long Island, New York, U
Old 10-27-2005 , 12:10  
Reply With Quote #6

Wound'nt it be: ?
Code:
new pHit
trace_result(TR_pHit,phit)
Charr is offline
Send a message via AIM to Charr Send a message via MSN to Charr
XxAvalanchexX
Veteran Member
Join Date: Oct 2004
Location: abort73.com
Old 10-27-2005 , 16:06  
Reply With Quote #7

I think if there are no extra parameters it returns the value as an integer. If there are one extra parameters it sets a float by reference. If there are two extra parameters it sets a string by reference. This is the general format of FM stuff.
__________________
No longer around. Thanks your support, everyone! As always:
THIS ONES FOR YOU
3000 PTS
XxAvalanchexX is offline
Freecode
Never Fall Asleep
Join Date: Jan 2004
Old 10-27-2005 , 17:00  
Reply With Quote #8

Quote:
Originally Posted by XxAvalanchexX
pHit would probably be 0, and I assume that flFraction would be 1.0
no it would be -1, even though proly should be 0 as 0 is world in HL engine

Code:
case TR_Hit:         if (!FNullEnt(g_tr.pHit))             return ENTINDEX(g_tr.pHit);         else             return -1;
and yes use avalanches way as it sets the var to return value by the native.
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 23:40.


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