Forum

Traceline Questions

Discuss programming in the QuakeC language.

Moderator: InsideQC Admins

Traceline Questions

Postby Junrall » Mon Sep 21, 2009 12:51 am

Hello all!

I'm playing around with traceline and am trying to figure out what trace_allsolid and trace_startsolid are and how they are used.

So far all I can determine about trace_allsolid and trace_startsolid is that both will return a 1 when ever the starting point of a traceline touches a solid. They seem to act exactly alike.

What is the difference between trace_allsolid and trace_startsolid?
Are they able give more info... other than a 1 or 0?

Thanks!!
User avatar
Junrall
 
Posts: 191
Joined: Mon Sep 21, 2009 12:27 am
Location: North West Oregon, USA

Postby Electro » Mon Sep 21, 2009 1:33 am

If the start and end points of the traceline were all inside solid, then allsolid is TRUE.

Otherwise, if it just starts in a solid, but ends up in open space, only startsolid is set.
Benjamin Darling
http://www.bendarling.net/

Reflex - In development competitive arena fps combining modern tech with the speed, precision and freedom of 90's shooters.
http://www.reflexfps.net/
Electro
 
Posts: 312
Joined: Wed Dec 29, 2004 11:25 pm
Location: Brisbane, Australia

Traceline and trace_allsolid

Postby Junrall » Wed Sep 23, 2009 5:01 am

Ok... maybe traceline and trace_allsolid is not working properly or I'm doing something wrong. Here is the code I'm using... and here is a short in-game avi video ( http://www.megaupload.com/?d=O0C3KJI8 ) of my traceline being drawn with two X's and some bubbles. The red X is the starting point and the blue X is the stopping point. I am centerprinting the value of trace_allsolid.
As you can see, in the video, the only time that trace_allsolid returns a 1 is when the start of trace line touches a solid... it doesn't matter if the end point is in or out of a solid.
Any tidbit of info would be greatly appreciated.
Code: Select all
float() test_obstruction =
{
   local vector start, stop, ang;
   local float hgt;
   local string h;
   
   makevectors (self.angles);
   
   ang = normalize(v_forward) * 60;   
   ang_z = 0;
   
   start = self.origin + ang;
      
   stop = start;
   stop_y = stop_y + 60;
   
   traceline(start, stop, TRUE, self);
   
   h = ftos(trace_allsolid);
   centerprint(self, h);

   if (trace_allsolid)
   {      
      return;
   }
      
};
User avatar
Junrall
 
Posts: 191
Joined: Mon Sep 21, 2009 12:27 am
Location: North West Oregon, USA

Postby r00k » Thu Sep 24, 2009 3:49 am

return true;
?
r00k
 
Posts: 1110
Joined: Sat Nov 13, 2004 10:39 pm

Postby Junrall » Thu Sep 24, 2009 5:34 am

r00k wrote:return true;
?


The 'if' statement and 'return' are remnants of previous code. I should have removed it before posting... sorry 'bout that.

I am using centerprint to print the output of trace_allsolid. It will print 1 (TRUE) or 0 (FALSE)... depending on whether or not the traceline's starting point is in a solid.

I had thought that the entire traceline had to be in a solid before trace_allsolid would return a 1 (TRUE)... this is not the case. It will return a 1 (TRUE) any time the start of the trace line is in a solid... even if the end of the traceline is not in a solid.
Infact, trace_allsolid and trace_startsolid act exactly the same.

If I wasn't bald... I'd be pulling my hair out!
User avatar
Junrall
 
Posts: 191
Joined: Mon Sep 21, 2009 12:27 am
Location: North West Oregon, USA


Return to QuakeC Programming

Who is online

Users browsing this forum: No registered users and 1 guest