Forum

specific traceline?

Discuss programming in the QuakeC language.

Moderator: InsideQC Admins

specific traceline?

Postby blubswillrule » Sun Feb 20, 2011 8:43 am

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 :)
User avatar
blubswillrule
 
Posts: 68
Joined: Mon Oct 04, 2010 9:08 pm
Location: Lincoln, California

Postby Error » Sun Feb 20, 2011 9:42 am

...do a traceline from one entity to the other... yes... do exactly that?
User avatar
Error
InsideQC Staff
 
Posts: 865
Joined: Fri Nov 05, 2004 5:15 am
Location: VA, USA

Postby blubswillrule » Sun Feb 20, 2011 9:56 am

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 :)
User avatar
blubswillrule
 
Posts: 68
Joined: Mon Oct 04, 2010 9:08 pm
Location: Lincoln, California

Postby GiffE » Sun Feb 20, 2011 5:30 pm

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.
GiffE
 
Posts: 170
Joined: Sun Oct 08, 2006 3:39 pm
Location: USA, CT

Postby Ranger366 » Mon Feb 21, 2011 7:15 am

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

http://www.quake-1.com/docs/quakesrc.org/49.html
User avatar
Ranger366
 
Posts: 203
Joined: Thu Mar 18, 2010 5:51 pm

Postby Jukki » Tue Feb 22, 2011 4:58 am

Blubs means he wants to know if there is a traceline that can go trought walls
Jukki
 
Posts: 214
Joined: Wed Apr 07, 2010 4:59 am

Postby DusterdooSmock » Tue Feb 22, 2011 5:27 am

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..
DusterdooSmock
 
Posts: 170
Joined: Thu Aug 19, 2010 9:58 pm

Postby blubswillrule » Tue Feb 22, 2011 5:54 am

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 :)
User avatar
blubswillrule
 
Posts: 68
Joined: Mon Oct 04, 2010 9:08 pm
Location: Lincoln, California

Postby GiffE » Tue Feb 22, 2011 8:42 pm

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.
GiffE
 
Posts: 170
Joined: Sun Oct 08, 2006 3:39 pm
Location: USA, CT


Return to QuakeC Programming

Who is online

Users browsing this forum: No registered users and 1 guest