Organizing Exits (solved)

When playing a quest game, the exits show up in the order they're created in the program. So all my exits are arranged in random order.

Is there a way to have a unified display for exits? For instance it always shows the exits starting from NW-N-NE going clockwise?

Otherwise all my rooms have exits in random order and it's hard to move the exits within the project view without them trying to be the child of another exit.

EDIT: Just to clarify, in one room the available exits would be
north, west, south-east, east.
But in the very next room the exits might be
east, south-west, north, south-east

Again depending on which exits I created first for that room


You could override FormatExitList.

  <function name="FormatExitList" type="string" parameters="preList, list, preFinal, postList">
    <![CDATA[
    result = ""
    listLength = ListCount(list)
    if (listLength > 0) {
      orderedList = NewObjectList()
      foreach (dir, Split ("northwest;north;northeast;east;southeast;south;southwest;west;up;down;in;out")) {
        orderedList = ListCombine (orderedList, FilterByType (list, dir+"direction"))
      }
      orderedList = ListCombine (orderedList, ObjectListSort (ListExclude (list, orderedList), "alias"))
      count = 0
      result = preList + " "
      foreach (item, orderedList) {
        result = result + GetDisplayNameLink(item, "exit")
        count = count + 1
        if (count = listLength - 1) {
          result = result + " " + preFinal + " "
        }
        else if (count < listLength) {
          result = result + ", "
        }
      }
      result = result + postList
    }
    return (result)
  ]]>
  </function>

This is awesome, Thank you. I also looked up Functions, including Functions, and overriding functions to implement your code. So I learned a lot.


You might also want to have a look at this thread for alphabetizing the object list.
http://textadventures.co.uk/forum/quest/topic/sndmg3rcdecgbayrcqx2ka/alphabetized-you-can-see-object-list


Log in to post a reply.

Support

Forums