check Room Name



  • it would be helpful for my sanity to have a way to test if a string is a valid room name or not.

    While I admit that I could write something myself that would do the job, the gets thorny quickly when you consider non-visible rooms as well. Then I need to either depend on some assumptions about the map size and shape and use constants, or somehow find some function I can abuse to somehow test if a non-visible room name even exists.

    To the best of my awareness from digging, the only clean and reliable option here is going to be to ask you nicely to provide something.

    Thanks!



  • Generally, any string is a valid room name. In addition to the typical E##S## rooms, there's also "sim" and the roadmap includes combat arena rooms that will probably have names something like like "arena_######".

    Game.map.isRoomAvailable(roomName) will tell you if a room is an open part of the map, which might be what you want. It doesn't include the greyed out rooms at the edge of the map and through the middle of novice zones, though.

    You might also want Game.map.describeExits(roomName) which will return null for nonexistent rooms.