Exit and enter scene doorways from correct direction

I want to make a basic dungeon exploring game where each door of a room makes the player change scenes to the next room.

How do I make it so that when the player exits from the south door of a room, he enters through the north door of the next?

In other words, there might be four entrances to a room, how do I make the player enter through the correct door?

try searching the forum there was something similar to what you need.
i think it was made last year , some robot flying around going from one scene to another.

I really wish people would learn not to do the “search the forum” / rtfm / ltgtfy thing. It assumes bad things about people asking for help and frankly, on a help forum… it’s rude.

If it’s relevant, here are some of the forum searches I had tried with no answer…
entrance exit direction
doorways
maze platform
room scene walking
robot maze” (added trying to find the one you mention - thanks. The one I found uses elevators but does not seem to address the directional door issue)

I did succeed though… figured out the solution myself with helpful ideas from another thread.
For reference sake, that thread is…
http://blenderartists.org/forum/showthread.php?t=166649

Example file download: Click here
…it’s kind of complicated for what I was after, and could use polishing (e.g. strange results if entering a door diagonally), but does not use python and does work.

if you still need help . i made a very simple version of that script.you can download it from my blog

Perhaps on the doorway you enter there is a property, say “exit” which has the objects name of the doorway it attaches to. e.g:

cont = GameLogic.getCurrentController()
own = cont.owner # < This is the player

door_collision = own.sensors['door_collision']

if door_collision.positive:
    door = door_collision.hitObject # May not be the right attribute, check the docs if it doesnt work
    GameLogic.globalDict['exit door']  = door['exit']
    # scene change

Then on the receiving scene you could have code similar to:

cont = GameLogic.getCurrentController()
own = cont.owner # The player again

scn = GameLogic.getCurrentScene()
obl = scn.objects

door = obl[ GameLogic.globalDict['exit door'] ]

own.position = door.position
own.orientation = door.orientation

Just something simple like that, communicating between scenes is the key here.