specific traceline?

Discuss programming in the QuakeC language.
Post Reply
blubswillrule
Posts: 68
Joined: Mon Oct 04, 2010 9:08 pm
Location: Lincoln, California

specific traceline?

Post by blubswillrule »

I know there is a way to check if there is anything between two entities using tracelines,

but what if I wanted it to only check for a certain type of entity?
(like, a certain classname, or one that has certain flags)


I need to check if there is a door between 2 entities basically, it mustn't check for walls, only door, could there be ANY way to do this?

thanks :)
A truly rewarding experience for an AI coder: watching your ai navigate the map... makes all the time invested in the code worth it :)
Error
InsideQC Staff
Posts: 865
Joined: Fri Nov 05, 2004 5:15 am
Location: VA, USA
Contact:

Post by Error »

...do a traceline from one entity to the other... yes... do exactly that?
blubswillrule
Posts: 68
Joined: Mon Oct 04, 2010 9:08 pm
Location: Lincoln, California

Post by blubswillrule »

but the thing is, I don't want it to check for walls, only for certain entities
A truly rewarding experience for an AI coder: watching your ai navigate the map... makes all the time invested in the code worth it :)
GiffE
Posts: 170
Joined: Sun Oct 08, 2006 3:39 pm
Location: USA, CT
Contact:

Post by GiffE »

I don't fully understand your question but I'll give a shot at my two different interpretations of the question.

If you just want to check if there is a door entity between you just fire a trace and do a trace_ent.classname == "func_door" to check if its a door entity.

If you want to have the trace go through something:

1.) Trace from first entity forward (or where ever)
2.) if(trace_fraction < 1.0) // you hit something
3.) if(trace_ent.classname == "func_door") // check if its a door entity but could be anything
4.) Since we hit a door and we want it to go through... start a second trace starting from trace_endpos and continuing forward. Set the ignore entity to trace_ent. I'm pretty sure if it starts in a solid it ignores it until it comes outside too.
Ranger366
Posts: 203
Joined: Thu Mar 18, 2010 5:51 pm

Post by Ranger366 »

A good example for that is on QuakeSrc.org i think.

http://www.quake-1.com/docs/quakesrc.org/49.html
Jukki
Posts: 214
Joined: Wed Apr 07, 2010 4:59 am

Post by Jukki »

Blubs means he wants to know if there is a traceline that can go trought walls
DusterdooSmock
Posts: 170
Joined: Thu Aug 19, 2010 9:58 pm

Post by DusterdooSmock »

Jukki wrote:Blubs means he wants to know if there is a traceline that can go trought walls
He wants one that goes through walls, from one entity to another..
blubswillrule
Posts: 68
Joined: Mon Oct 04, 2010 9:08 pm
Location: Lincoln, California

Post by blubswillrule »

yes, one that goes through walls, BUT checks if it hits a door.

it would be nice to have, but not terribly important for the time being.
A truly rewarding experience for an AI coder: watching your ai navigate the map... makes all the time invested in the code worth it :)
GiffE
Posts: 170
Joined: Sun Oct 08, 2006 3:39 pm
Location: USA, CT
Contact:

Post by GiffE »

blubswillrule wrote:yes, one that goes through walls, BUT checks if it hits a door.

it would be nice to have, but not terribly important for the time being.
Yea to go through walls or the map bsp you'd have to use a series of traces (while loop'd or recursive) stop when you've either hit a door or you reached your destination.
Post Reply