Get DIF Zones?
by FruitBatInShades · in Technical Issues · 03/01/2005 (5:25 pm) · 3 replies
I am trying to implement a feature where a player can report where he is in the level. I'd 'like' to be able to get the DIF.Portal zone he;s in as that would be a simple solution. Does anyone know how to go about getting this info or another way to approach the problem?
#2
Whenever you wanted to do a "Where is this player", grab that group, and do a raycast (disable collisions with walls etc) to each object, return the name of the Marker it is closest to.
I suggest this instead of a different way because there is no way to assure that a player is in the corner of one zone, right about to border into the other zone, and it will still report his current zone, even though he is closer to being in another zone than in his current one (if that makes sense). Say you have a zone which is a really long corodor. The next zone is a room at the end. If he is almost at the room, he is closer to the zone of the room than he is the center of the corodor. In this way, you could also have multiple Markers in the same physical "Zone" and it would work outdoors as well.
03/01/2005 (6:36 pm)
I would create a SimGroup with a bunch of Marker objects. The name of the marker object would be the name of the area the player was in. Whenever you wanted to do a "Where is this player", grab that group, and do a raycast (disable collisions with walls etc) to each object, return the name of the Marker it is closest to.
I suggest this instead of a different way because there is no way to assure that a player is in the corner of one zone, right about to border into the other zone, and it will still report his current zone, even though he is closer to being in another zone than in his current one (if that makes sense). Say you have a zone which is a really long corodor. The next zone is a room at the end. If he is almost at the room, he is closer to the zone of the room than he is the center of the corodor. In this way, you could also have multiple Markers in the same physical "Zone" and it would work outdoors as well.
#3
Any idea what object I should base the markers on(GameBaseData, Staticshape, should I even use a DTS)? All I need is an X,Y,Z,Tag. I'd have to sort by Z first I assume because I have floors on top of floors and a marker may be closer in Z if there is one underneath where they are standing.
@Pat: I was thinking about the problem when you are in between 2 areas. I am still not sure how that technique would differentiate if the player is closer to the next rooms markers, but still in a previous area?
03/02/2005 (2:22 am)
Thanks Brett and Pat :)Any idea what object I should base the markers on(GameBaseData, Staticshape, should I even use a DTS)? All I need is an X,Y,Z,Tag. I'd have to sort by Z first I assume because I have floors on top of floors and a marker may be closer in Z if there is one underneath where they are standing.
@Pat: I was thinking about the problem when you are in between 2 areas. I am still not sure how that technique would differentiate if the player is closer to the next rooms markers, but still in a previous area?
Torque Owner Brett Fattori
- Brett