Map Question

Is there a way to show all the rooms on the map without the player entering the room?


Yes. I think there's a script somewhere which simulates walking the player around the map to calculate the coordinates of all the rooms. I can't find it in the documentation at present, but it shouldn't be too hard to come up with something similar.

Off the top of my head:

rooms_to_process = NewObjectList()
list add (rooms_to_process, game.pov.parent)
while (ListCount (rooms_to_process) > 0) {
  // draw the rooms which aren't drawn, and calculate coordinates for their neighbours
  foreach (room, rooms_to_process) {
    Grid_CalculateMapCoordinates (room, game.pov)
    Grid_DrawRoom (room, false, game.pov)
  }

  // Get a dictionary of room coordinates, and check if any of the rooms in it aren't drawn yet
  rooms_to_process = NewObjectList()
  known_coordinates = Grid_GetPlayerCoordinateDictionary (game.pov)
  foreach (roomname, known_coordinates) {
    room = GetObject (roomname)
    if (not Grid_GetRoomBooleanForPlayer (game.pov, room, "grid_isdrawn")) {
      list add (rooms_to_process, room)
    }
  }
}

Log in to post a reply.

Support

Forums