zMUD mapping

by Lehki

Back to Mechanic's Corner.

Lehki2010-03-02 19:23:24
I've been trying to get the zMUD mapper to start working on different elevations and I came up this trigger for capturing room names.

CODE
#REGEX "Room_Name" {^(?:In the trees above )?()?(+\\.)$} {
  #var RoomName {%upper( %1)%2};
  #tag name @RoomName
} "Map" {line=6}


Everything works fine when I'm moving around on ground level. I've checked and RoomName ends up with the same value whether or not I'm on ground or tree elevation. When building new rooms on the map this works fine capturing them whether I'm on the ground or tree. But when I'm just moving around in the trees the mapper won't make a match for movement and gets stuck. My best guess is that zMUD is overriding the '#tag name' there with it's own that uses the whole 'In the trees above etc' but I'm not sure how I'd turn it off then, unchecked all the boxes in the configuration window having to do with room names already. ):
Unknown2010-03-02 19:30:44
Try a better regex. I capture the room as a single wildcard and just capitalize the first letter, but you can probably figure that part out...

CODE
^(?:In the trees above |Flying above |On the rooftops over |In a pit at |In the mountains above |In a nest above )?(.+?\\.?)$


Oh, and I have this set to only match on my room title colors. Otherwise, you get a lot of matches you didn't want.
Atellus2010-03-02 19:37:47
QUOTE (Zarquan @ Mar 2 2010, 11:30 AM) <{POST_SNAPBACK}>
Oh, and I have this set to only match on my room title colors. Otherwise, you get a lot of matches you didn't want.


I just wanted to second this suggestion. When I used zmud to map the only really reliable way I could figure out was to ensure my room names had a unique ansii color and match based on that.

With CMUD and MXP (and ATCP) these days things are a lot easier. The latest beta version of CMUD will map rooms with 0 triggers set up on my end. It still has some issues but it is so much easier.

ZMUD supports MXP triggers (though I have never used them) so you might look at doing that instead. It is a much cleaner solution than any regex or ansii hack.
Lehki2010-03-02 19:38:46
QUOTE (Zarquan @ Mar 2 2010, 02:30 PM) <{POST_SNAPBACK}>
Try a better regex. I capture the room as a single wildcard and just capitalize the first letter, but you can probably figure that part out...

CODE
^(?:In the trees above |Flying above |On the rooftops over |In a pit at |In the mountains above |In a nest above )?(.+?\\.?)$


Oh, and I have this set to only match on my room title colors. Otherwise, you get a lot of matches you didn't want.

I'm going to add in those other elevations after I get this first one working. I'm not sure how to make just the first letter capital with a zMUD variable, which is why I do it with two captures, and it already matches line color. That's what the {line=6} is.
Unknown2010-03-02 19:47:17
In that case, how about this minor adjustment instead?

CODE
^(?:In the trees above )?(\\a)(.+?\\.)$


1. Don't make the first letter optional with the ? and the square brackets are superfluous.
2. Use just a general capture for the rest of the room and don't worry too much about special characters.
3. Make the second capture non-greedy with the addition of the question mark, which should make your first capture work the way you expected.
Lehki2010-03-02 19:52:57
QUOTE (Zarquan @ Mar 2 2010, 02:47 PM) <{POST_SNAPBACK}>
In that case, how about this minor adjustment instead?

CODE
^(?:In the trees above )?(\\a)(.+?\\.)$


1. Don't make the first letter optional with the ? and the square brackets are superfluous.
2. Use just a general capture for the rest of the room and don't worry too much about special characters.
3. Make the second capture non-greedy with the addition of the question mark, which should make your first capture work the way you expected.

My first capture DOES work the way I expected. I'll give it a try anyway, but I think the issue has something to do with how the zMUD mapper works, and not with the Regex.

EDIT: Yeah, I'm having exactly the same behavior now.
Unknown2010-03-02 19:56:53
Ask Lendren. He does all sorts of crazy things with that mapper now. I always had to fight with it to get it to sorta kinda work, so I'm much happier with my script now, even if it is a little slow sometimes.
Lendren2010-03-02 22:16:15
Actually after struggling with the automatic capture I found it was easier for me to do a manual capture than to correct all the times zMUD didn't capture right. So I use an alias that fires off a hideously complex set of processes to capture everything imaginable about a room, and it's gnarly code since it was the first big thing I did in zMUD, way back in Aetolia. It's too ugly to squint at, but I don't do anything about it because it works perfectly well. I never bothered to try to make it handle all those elevations, though. I just do my mapping on ground level. In the painfully rare case I might have to map from another elevation, I just tweak that bit out by hand.
Unknown2010-03-02 22:18:16
I think it's more about following you at those other elevations than doing the actual mapping.
Lehki2010-03-02 22:19:00
QUOTE (Lendren @ Mar 2 2010, 05:16 PM) <{POST_SNAPBACK}>
Actually after struggling with the automatic capture I found it was easier for me to do a manual capture than to correct all the times zMUD didn't capture right. So I use an alias that fires off a hideously complex set of processes to capture everything imaginable about a room, and it's gnarly code since it was the first big thing I did in zMUD, way back in Aetolia. It's too ugly to squint at, but I don't do anything about it because it works perfectly well. I never bothered to try to make it handle all those elevations, though. I just do my mapping on ground level. In the painfully rare case I might have to map from another elevation, I just tweak that bit out by hand.


My problem isn't creating the map, it's moving around an already created map while I'm in tree elevation. ):
Lendren2010-03-03 00:57:59
Yeah, mine doesn't match room names at all when moving, so I don't have this problem moving. (I trigger on the "You see exits" bit to #ok each move. Set all this up in Aetolia like 7 years ago, and while it might not be optimal, and might not be what I'd end up with if I were to start from scratch today, it works plenty good, and it's not worth revisiting.)