specific traceline?
Moderator: InsideQC Admins
9 posts
• Page 1 of 1
specific traceline?
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
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 
-

blubswillrule - Posts: 68
- Joined: Mon Oct 04, 2010 9:08 pm
- Location: Lincoln, California
-

Error - InsideQC Staff
- Posts: 865
- Joined: Fri Nov 05, 2004 5:15 am
- Location: VA, USA
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 
-

blubswillrule - Posts: 68
- Joined: Mon Oct 04, 2010 9:08 pm
- Location: Lincoln, California
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.
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
A good example for that is on QuakeSrc.org i think.
http://www.quake-1.com/docs/quakesrc.org/49.html
http://www.quake-1.com/docs/quakesrc.org/49.html
-

Ranger366 - Posts: 203
- Joined: Thu Mar 18, 2010 5:51 pm
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
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.
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 
-

blubswillrule - Posts: 68
- Joined: Mon Oct 04, 2010 9:08 pm
- Location: Lincoln, California
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
9 posts
• Page 1 of 1
Who is online
Users browsing this forum: No registered users and 1 guest