Exit Detection

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


You can do something like this:

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

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


This topic is now closed. Topics are closed after 60 days of inactivity.

Support

Forums