trace_line to the ground
Hi, I've read a lot of posts that suggest tracing a line to the ground, but I've not seen one that shows the actual code for doing so.
Would I be allowed to just set the endpoint to 5000 below the starting point, or is there some optimal value I should set it to? Also, I'm finding random spots above the ground. How do I know when my spot I've found is below the entire map? What I have is fully functional, I just don't know if my methods are terrible or not. |
Re: trace_line to the ground
Please show some code, and tell why you do that.
|
Re: trace_line to the ground
Not much to show. I have defined two points that create a large box in a map. Within this box, I wish to spawn things 50 units above the ground. Here's how I'm getting my points (this works):
PHP Code:
The Origin[2]<-5000.0 condition is what I check against to see if my random start point was created inside of a wall, in which case it traces through the map to the huge number below, and I do it again. |
Re: trace_line to the ground
I think you need just one trace. Start shoud be the same as End, and End[2] you remove 5000. Get the TR_flFraction of the trace, if <1.0, you have touched something, otherwise nothing.
|
Re: trace_line to the ground
Heh, sorry, it's my first time working with trace_line. I couldn't find any good posts on it when searching for trace_line, but I found some good tutorials while looking for TR_flFraction. I should be okay now. ;)
Thanks. |
| All times are GMT -4. The time now is 15:10. |
Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.