Exit Detection

yellowyellow
22 Jan 2017, 15:53

How can a script detect if a room has an exit in certain direction?


Pertex
22 Jan 2017, 16:00

You can do something like this:

      foreach (exit, ScopeExitsForRoom(room)) {
        if (exit.alias = "south"){
             msg("you can go south")
        }
      }

The Pixie
22 Jan 2017, 16:22

There is a function that does just this, GetExitByName (note that is returns the name of the exit, rather than the exit itself):
http://docs.textadventures.co.uk/quest/functions/getexitbyname.html