Traceline problem
Moderator: InsideQC Admins
5 posts
• Page 1 of 1
Traceline problem
Hi everyone, its venomus. After seeing this Qexpo I was inspired to start modding for Quake again. Trying to remake the gauss gun from half-life as a weapons mod.
But I've run into some weird problems with traceline. Let me explain how the weapon works with these diagrams.
First traceline, hit a wall

If the conditions are right for wall penetration (right angle, secondary fire), do another trace from just inside the wall to the same end point

As long as trace_allsolid != 1 (i.e. we didn't fire into the outer hull of the map), trace back to find the point where we exited the first wall.
At the current trace_endpos we would now do an explosion, and that's how it's supposed to work. Sometimes it does work properly, but other times the following happens: the trace_allsolid test returns true even if there is a void of empty space along the third traceline. If I remove the trace_allsolid test, then the third traceline still fails to find the correct exit point.
This seems to happen in certain places but not others, for example if I am standing facing the Normal Skill teleporter in the start map and fire at Hard Skill wall, it works correctly. But if I fire at the Easy Skill wall it does not.

But I've run into some weird problems with traceline. Let me explain how the weapon works with these diagrams.
First traceline, hit a wall
- Code: Select all
makevectors (self.v_angle);
v = v_forward;
st = self.origin + '0 0 16';
...
en = st + v * 15000;
traceline (st, en, FALSE, self);

If the conditions are right for wall penetration (right angle, secondary fire), do another trace from just inside the wall to the same end point
- Code: Select all
entrance = trace_endpos;
in_a_bit = entrance + v;
traceline (in_a_bit, en, TRUE, self);
far_wall = trace_endpos - v;

As long as trace_allsolid != 1 (i.e. we didn't fire into the outer hull of the map), trace back to find the point where we exited the first wall.
- Code: Select all
if (trace_allsolid)
{
return;
}
traceline (far_wall, entrance, TRUE, self);
At the current trace_endpos we would now do an explosion, and that's how it's supposed to work. Sometimes it does work properly, but other times the following happens: the trace_allsolid test returns true even if there is a void of empty space along the third traceline. If I remove the trace_allsolid test, then the third traceline still fails to find the correct exit point.
This seems to happen in certain places but not others, for example if I am standing facing the Normal Skill teleporter in the start map and fire at Hard Skill wall, it works correctly. But if I fire at the Easy Skill wall it does not.

- venomus
- Posts: 41
- Joined: Tue May 24, 2005 4:54 pm
Doesn't seem to make a difference. If I remove the trace_allsolid test entirely, then the third traceline fails to hit on the opposite side of the wall on its way back, i.e. trace_endpos = entrance . It's as if it can't detect any empty space on the other side of the wall.
- venomus
- Posts: 41
- Joined: Tue May 24, 2005 4:54 pm
Well it's been a long time coming (mainly because I put off trying to fix it and got on with other things, Quake related or not). But I'm now pretty sure that a traceline starting in solid will not work properly.
While I will do my best to try and understand the collision detection code (not a given), if anyone can prove me wrong and point to an example of working tracelines starting in solid I'd be interested in looking at them. Examples might be weapons that fire through walls like in counterstrike, I looked for weapon mods or similar with something like that but did not find any.
While I will do my best to try and understand the collision detection code (not a given), if anyone can prove me wrong and point to an example of working tracelines starting in solid I'd be interested in looking at them. Examples might be weapons that fire through walls like in counterstrike, I looked for weapon mods or similar with something like that but did not find any.
- venomus
- Posts: 41
- Joined: Tue May 24, 2005 4:54 pm
5 posts
• Page 1 of 1
Who is online
Users browsing this forum: No registered users and 1 guest