|
Aconite Newbie
Joined: 06 Jan 2010 Posts: 3
|
Posted: Wed Jan 06, 2010 11:09 pm
Mapper Question |
I'm fairly new to Cmud, and the mapper function. I'm currently trying to help out a Mud Administrator and map out some zones for them.
I had some luck with the mapper function, but I noticed it duplicated rooms and didn't map accurately. I have since then gotten Wiz powers to see the room number. I thought this might be benefical because duplicate room names appear in the mud, but the actual room number is unique. I thought that since this could give a better accurate picture of the map, it would help out the mapper program.
I am having some difficulty configuring the mapper to pick up on the room number. I think it has to deal with the way the MUD presents the room number. The following is an example description of the MUD and rooms:
< 581H 1486M 591V -25A >
e
[ 4308] The Eastern Highway [ NONE ] [ Road ]
You travel along a wide, busy highway, which leads east and west.
The road is bordered to the north by a strip of green grass, and to
the south you see hills stretching into the distance.
[ NPK ] [ Exits: n e s w ]
< 581H 1486M 591V -25A >
When configuring the mapper, it picks up on exits okay, and it seems to find the prompt alright, but I can't get it to pick up the room name or room number.
I've been reading around the forum looking for ways to get around this, but I'm falling short due to my inexperience with the scripting language. Could someone point out how I can set the mapper to accurate capture the room name and number?
Thanks!
-Aconite
***
Also, I want to make the point that when I do not have the room number visable, the mapper seems to pick up on the rooms. However, on testing it out and trying to map a zone, the mapper gets easily confused and does not correctly map the zone. It gets confused and starts creating rooms when it shouldn't be. |
|
|
|
Dumas Enchanter
Joined: 11 Feb 2003 Posts: 511 Location: USA
|
Posted: Thu Jan 07, 2010 3:08 am |
Hard to tell on the room name line if there are spaces before the room number and around NONE and Road.
If there isn't
#REGEX {^[(\d+)] (*) [\w+] [\w+]$} {#TAG vnum %1;#TAG name %2}
Add or remove spaces where needed to match.
If this isn't quite correct, someone please do so. Not entirely sure using (*) is correct.
You will have to reconfigure the map after this. And I'm sure someone smarter than me can even make it so that it will work even if you do not have the room number displayed. |
|
|
|
MattLofton GURU
Joined: 23 Dec 2000 Posts: 4834 Location: USA
|
Posted: Thu Jan 07, 2010 3:35 am |
Dumas, [] is used to denote a range in regex, so you'd have to escape those in the appropriate places (I think it's sufficient to just escape the opening bracket).
Anywho, if the player-level room name is only letters and spaces then you can maybe use ^({~[*~]|})([%w%s])({~[*~]|})$ to capture both wiz and non-wiz versions. You can easily #TAG %2, but you'll need to first test and then parse %1 to get the vnum. Before doing the tagging, you may want to use #PRINT and run around/play awhile to see how good the matching is. If the pattern needs more tweaking then you're not going to cause any damage to your map trying to fix it.
You will also have to tag the prompt, but that shouldn't be much of a challenge. |
|
_________________ EDIT: I didn't like my old signature |
|
|
|
Aconite Newbie
Joined: 06 Jan 2010 Posts: 3
|
Posted: Thu Jan 07, 2010 3:53 am |
Wow, thanks guys! I actually went with a different route in order to configure the mapper.
I ended up gagging the line, capturing only the variables I want (room name and number) and then echoing it out in it's place. Worked fine after that!
However, as I'm diving deeper into the mapping program, I've stumbled across a problem.
The mud I play on does not use exits such as NW NE SW SE. The problem I'm encountering is when I find a close door / gate. The exits typically displays as follows:
[ Exits: n e s w ]
However, when there is a close door / gate, the exit changes to something like this:
[ Exits: |n| e |s| w ]
Where the exits that are enclosed in the pipe character are close exits. Is there a way to configure the mapper to recognize these as doors?
Thanks! |
|
|
|
Dumas Enchanter
Joined: 11 Feb 2003 Posts: 511 Location: USA
|
Posted: Thu Jan 07, 2010 3:54 am |
Blast! Those slashes were in there when I typed it in. Must remember to use code block next time.
|
|
|
|
MattLofton GURU
Joined: 23 Dec 2000 Posts: 4834 Location: USA
|
Posted: Thu Jan 07, 2010 5:56 am |
Quote: |
The mud I play on does not use exits such as NW NE SW SE.
|
This part really doesn't matter, but if you want to disable the associated macros and directions then do the following:
1)open up CMud's Package Editor
2)click on the View|Show Default Packages menu
a)Default Settings
b)Clickable URLs
c)English Keypad
d)English Directions
3)click on the tab for English Directions
4)click on the View|Show|Directions menu
5)select all the directions you want to save (in your case, that's everything in the Directions class)
6)CTRL-C them to the clipboard
7)go to a different package (any package other than the above four)
8)CTRL-V them into the settings tree
9)Repeat the above steps for anything in the English Keypad package you want to save.
10)right-click on the English Directions package and select Delete Tab to remove the package from your session.
11)do the same for the English Keypad package.
You can't just disable or delete those classes in those packages, because they ship with every version of CMud--so any time you would upgrade it'd re-enable/reinstall them.
Quote: |
Where the exits that are enclosed in the pipe character are close exits. Is there a way to configure the mapper to recognize these as doors?
|
Code: |
#trigger {~[ Exits: (*) ~]} {
#forall %replace(%replace(%1,"|","+")," ","|") {
#if (%len(%i) > 1) {
#call %match(%i,"+(%w)+",$dir)
#additem exits.doors $dir
} {#additem exits.notdoors %i}
}
#tag exit @exits.notdoors
}
#event onRoomCreate {#forall @exits.doors {#door %i}}
|
I didn't test the code and I am using the beta, so there might be errors and they might be specific to the public version, but the intent is to follow this process:
1)to only #tag the normal exits
2)let CMud create the room
3)after creation (assumption: room created, location updated, then onRoomCreate event fired), add door exits
If my assumption is wrong, the timing is going to be off and the #door command will probably be applied to the wrong room's exits. Also, CMud seems to correctly detect that there's a door there but I don't have a door and an unexplored room handy to check if room creation maintains the door status when completing the exit link.
Finally, #tag is used so you'll need to run the reconfigure again to include it. |
|
_________________ EDIT: I didn't like my old signature |
|
|
|
Aconite Newbie
Joined: 06 Jan 2010 Posts: 3
|
Posted: Thu Jan 07, 2010 3:21 pm |
Awesome guys! I really appreciate all the feed back!
I do have some more questions though!
I'm doing fairly well with the mapping I've got going on, however, I've noticed that sometimes the mapper still doesn't recongize that I've moved successfully. It does a decent job or noticing that I haven't moved. I have to constantly do a sanity check to reposition my current location. Once I use the look function on the mapping module, it finds me okay. I'm just wondering what I can do to help the mapper understand when I've moved.
I've setup some helpful triggers to understand when I've not moved, like what it said in the tutorial.
Triggers like, "You can move that direction", and "That door is closed", using the #NODIR values.
Also, my typical mud prompt is as follows:
< 619H 1652M 597V 196A >
I've setup a trigger to do the following so that the mapper ignores this text:
#Trigger {^~<*~>} {#NODIR}
I believe this is helping the mapper understand that it should ignore anything in <> (which is my mud prompt).
Is there anything else I could do to help this?
Thanks!
-Aconite |
|
|
|
MattLofton GURU
Joined: 23 Dec 2000 Posts: 4834 Location: USA
|
Posted: Thu Jan 07, 2010 6:18 pm |
No, #NODIR is used to prevent movement. Essentially, your trigger tells cmud to not move upon successfully determining that you went into a different room. Try changing #NODIR to #TAG prompt.
|
|
_________________ EDIT: I didn't like my old signature |
|
|
|
Rahab Wizard
Joined: 22 Mar 2007 Posts: 2320
|
Posted: Thu Jan 07, 2010 7:03 pm |
Also make sure that trigger is marked as "trigger on prompt" instead of "trigger on newline".
|
|
|
|
|
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
|