I decided to start with the example for Two Towers from this thread, based on similarities, such as not having easily accessible rooms names, etc:
http://gammon.com.au/forum/?id=10536
The first thing I did was edit the main trigger to match SWmud.
Twin Towers code:
match="^\s{4}(?P<roomdesc>.*\n(\S.*\n)*)\s{4}The only obvious exit(s are| is) (?P<exits>.*)\.\Z"
SWmud code:
match="^(?P<roomdesc>\S.*\n(.*\n)*)(The only|There are .*) obvious exit(s:| is) (?P<exits>.*)\.\Z"
Here's an example SWmud room:
This is the transport facility, where the shuttles land. Since there are so many new destinations added to the shuttle network,
all privately owned vessels have been directed to the Main Dock to the east. The local ship merchant, Barloke, has a dock to the west.
The noise here is almost unbearable. Large passenger shuttles are constantly landing and taking off from this area.
There are three obvious exits: north, east, and west.
Dabear's Cabbie
So, right off, there's a couple of differences I tried to account for. Unlike Two Towers, room descriptions don't have 4 spaces to uniquely identify a chunk
of text from non-room descriptions. Also, sometimes you wind up with blank lines in the middle of the room description.
After playing around with modifying the match code a bit, I managed to get the mapper working... sort of. While it would map rooms, SWmud's lack of
unique room desc identifiers means I'd pick up all kinds of other stuff, which would in turn confuse the mapper into thinking a given room was multiple
rooms based on which direction I entered from.
Hmm. Perhaps there's a better way, but I experimented with putting the mapper trigger in a group along with a new trigger that would turn off the group
after it received the "exits" output. I then created a set of aliases that would tell the script engine to turn on the triggers and then execute the movement.
For example, I'd input a direction and would get something like:
Mapper_Triggers enabled
n
You climb the stairs back to the lobby.
The lobby of the Hall of Fame is a huge circular room which dwarfs even the tallest of Wookiees. An intricate pattern of stained glass fills
the ceiling above you and a polished marble floor lies underfoot. The Great Hall lies to the south, while a bar is located to the east for
those wishing to relax a bit during their visit to the Hall of Fame.
The smell of freshly-mixed drinks drifts in from the east.
Music from across the Star Wars galaxy is being piped in over the intercom.
There are three obvious exits: south, north, and east.
Mapper_Triggers disabled
Mapper adding room D2F16F90, name: You climb the stairs back to the lobby
An important-looking sign is here.
587/587 3 802144 8485 off undrugged >
Mapper_Triggers enabled
n
You are standing on the eastern end of Senate Blvd. To the east, you are amazed just how tall the Medical Facility of Imperial City is.
To the north is the Recruitment Center to enlist in the army or navy, and to the south is the glorious Hall of Fame, which houses likenesses
of all of the respected heroes and villains of the Empire.
There are four obvious exits: south, north, east, and west.
Mapper_Triggers disabled
Mapper adding room DC6DC520, name: There are three obvious exits: south, north, and east
As you can see, somewhere I've muffed up and in the 2nd room, it's grabbing the exits from the prior room and using it as the name for the 2nd room.
(I think)
post with full code to follow (when I can post again in 22 minutes)
