Achaea's built-in map system.

Posted by Windmill_Man on Mon 05 Apr 2010 07:10 AM — 39 posts, 123,169 views.

USA #0
This is my first post. I'm not experienced with MUD clients... but MUSHclient seems really nice. I think you've done a great job, Nick.

I'm sure every Achaean here knows of the map system Iron Realms has implemented into Achaea (and most likely all their other games as well). I was wondering if it were possible to make a miniwindow to show the output of the MAP command and have it update every time you move. I would think it would be simple... but I don't know the first thing about making plugins...

I realize the built-in map system isn't as powerful as the new ATCP Mapper Nick made, but I think it would still be cool.

I'm sorry if there's an answer to this question somewhere, I DID search for one and didn't find an answer.
USA #1
I did in fact write exactly this. :)

http://jonathan.com/?page_id=29

You'll need both the ATCP plugin and the MapWindow plugin; both go in your plugins/ directory. Enable both while you're disconnected, and make sure you have "Convert IAC EOR/GA to newline" checked in Game -> Configure -> Output.

It can get a little temperamental sometimes. If your output stops updating, try hitting MAP PARSE a few times to make sure it didn't get stuck gagging everything. There's a MAP HELP alias listing a few useful aliases, also. MAP MOVE <x> <y> lets you move the map around onscreen, for instance, where 0 0 would be the top-left corner.
USA #2
That's neat. I thought it would be simple... but there's a lot of files associated to the main plugin file. Never the less... thank you.

Hmm... there's seems to be an error though. If I type MAP MOVE 10 20, it actually moves to 20 20. It seems like the first number means nothing. It bases both variables off the second number.

Also... what's the difference between your ATCP plugin and Nick's ATCP plugin? And can the be loaded together without problems? The experience bar and the stat bar he made for Achaea install his plugin automatically....

I like the other plugins on your site. I would like to stick with the bars Nick made though. The wood-like graphics on the compass and stat bar look out of place without the whole frame Nexus has.
USA #3
They're not really that complex, I just split the files up because it's easier to work that way. It's a more structured paradigm, which I posted about a few months back. The plugin.xml file is just a header of sorts, a metadata file, and it <include>s a Plugger library I wrote that sets up paths and such for this structure. It then runs scripts/main.lua. I also have a Reflex library that lets you define aliases, triggers, and timers in pure Lua. So it's more of a framework, but I really like working with it that way.

I'll look into that bug, thanks...

The two ATCP plugins *should* work fine together. The difference is mostly that mine supports a library called PPI (a lesser version of which is included with MUSHclient). My PPI specifically supports registering function callbacks across plugin boundaries, so plugins that want to use ATCP just call atcp.Listen("message name", callback), and that callback is called when the "message name" message is received.

Thanks! The compass/gauges were actually written by Trevize (fadedparadox on these forums), and passed along to me. Dusty made the images.
USA #4
Well. The bug isn't really affecting me now. Since I removed the compass and stat bar... I could put the map window at 0 0 position without it covering anything.

I'm liking this plugin a lot! I love the map system... but typing MAP all the time gets tedious and bothersome. I figure with this plugin... I won't need the compass. The compass' only real use to me is to give me a visual of the available exits.

The two ATCP plugins seem to be running fine together. Can't say I am having any issues.

Now for the process of moving my reflexes from Nexus over. I tried to import them from the XML file Nexus can make... it didn't work though... damn...
Amended on Mon 05 Apr 2010 07:09 PM by Windmill_Man
USA #5
Windmill_Man said:
Now for the process of moving my reflexes from Nexus over. I tried to import them from the XML file Nexus can make... it didn't work though... damn...


Yeah, Nexus and MUSHclient (and Mudlet for that matter) use completely incompatible XML structures. Not to mention, Nexus uses totally different scripts and totally different pattern matching. By hand is just about the easiest way. :(

By the way, I found the bug. I was using y,y instead of x,y, just as you noted. Fixed and about to upload a new version.

Windmill_Man said:
I'm liking this plugin a lot! I love the map system... but typing MAP all the time gets tedious and bothersome. I figure with this plugin... I won't need the compass. The compass' only real use to me is to give me a visual of the available exits.


Glad you like it. :) It doesn't work anywhere there's no MAP output, but that's somewhat to be expected.
Amended on Mon 05 Apr 2010 07:08 PM by Twisol
USA #6
I suppose I'll redownload it then. Never been a bug tester before. ;)

One thing about doing it by hand... it looks a lot more complicated than Nexus...
Amended on Mon 05 Apr 2010 07:15 PM by Windmill_Man
USA #7
Windmill_Man said:
I suppose I'll redownload it then. Never been a bug tester before. ;)


Not quite up yet, having some file permissions problems. I'll edit when done :)

EDIT: Done.
USA #8
Cool. I really don't need it right now. I just figure I might as well have the working version. :P

EDIT: Yep. It works.
Amended on Mon 05 Apr 2010 09:46 PM by Windmill_Man
USA #9
I just colored the outer wood-like region of the compass (the area around the actual compass dial) black. Now it blends in perfectly with MUSHclient's "theme".

Worked for the gauges too. Cool...
USA #10
*sigh*

Twisol, you said the map window plugin could be temperamental at times... I haven't had a problem with it until now. Now it won't stop gagging everything. At first I thought it was just heavy lag from the MUD itself, then I realized it wasn't. There was something wrong with MUSHclient. I also use the roomname plugin that is on the same site the map plugin is, that, and the compass both still react when I try to move. So, it's not MUSHclient crashing... it's the output being totally gagged. MAP PARSE isn't doing anything either. I don't understand why it's happening though... it was working great before.
USA #11
Yeah. I warned you. =/ I've frozen development on it in light of Nick's new mapper - although it's not like it was particularly active before then either.

Here are a few things to try:

* Reinstall the plugin: File -> Plugins, click MapWindow, then Reinstall. Probably will only delay the inevitable.

* Go to Game -> Configure -> Output. Make sure the "Convert IAC EOR/GA to newline" checkbox at the bottom is checked.

* Post your prompt here. You might have a configuration I haven't accounted for, like the CONFIG PROMPT TEXT version. If it misses the prompt match, it could very easily gag everything.
USA #12
Reinstalling doesn't do much. It just does the same thing atfer it's installed.

Yes, I have that checked.

Mine is just the COMFIG PROMPT ALL:

1500h, 1500m, 6400e, 6400w ex-


I just don't understand why I'm having problems NOW. I've been using it for a while now with no problems at all. Now can't do ANYTHING with it without having problems. I've tried removing plugins/triggers that I've recently installed/made and it's still not working.

The mapper module Nick made is fine and all... I just don't like it that rooms can overlap and for some reason the whole world is 'area 0'. I have to use what I have to use though... I've been too pampered by the map to do without one! It's tiring to walk around blind...

Australia Forum Administrator #13
You must have a plugin that is doing one of those "omit everything from output until X arrives" and X never arrives.

Turn off other plugins first. I don't think the Achaea mapper has any of those sorts of triggers in it.
USA #14
Hmmmm. Have you added any other plugins recently, perhaps? And I assume that if you disable the map plugin, everything goes back to normal?

I've tried everything that's been the problem in the past. And my copy works fine. Something's not right... =/
Australia Forum Administrator #15
Ah I see Twisol's mapper does indeed have a trigger that matches on anything. So somehow that is probably not turning off.

Maybe you changed your prompt or something, and the mapper expects a prompt.
USA #16
Nick Gammon said:
Ah I see Twisol's mapper does indeed have a trigger that matches on anything. So somehow that is probably not turning off.

Correct, it's a sandwich-style setup. Matches the beginning, the end, and anything in-between. It should turn off after the end of the map, and I haven't seen any changes to the map-end line myself. It still works for me, too.

Speaking of which... Windmill Man, what's your map width/height? Try setting it to MAP RADIUS 5. I doubt that will do much, but here's hoping.

Quote:
Maybe you changed your prompt or something, and the mapper expects a prompt.

If only it was that simple... I had him post his prompt already, and it matches what I expect.
USA #17
Hmm... I thought I tried disabling all plugins besides the mapwindow and the ATCP plugin. To make sure, I tried it again. It was messing up like it has been at first... then I tried reinstalling it and it was working like it should. Then I decided to try enabling all plugins I had (besides Nick's mapper, of course) and it's still working. I don't know if it'll quit working... but it's working now. I don't know what's going on... but I guess I'll see what happens.

I have had my map radius at 5.
USA #18
Ah... the plot thickens! The places I was in that was giving me hell... was the Chrysalis Basilica in Shallam and Shastaan. I haven't been many other places... but I notice that as soon as I enter one of those two places. the mapwindow gags everything. I didn't know it was the particular place I was in that was doing it. apparently that's why the plugin was working for me just a minute ago... I wasn't in either of these two places. There's probably more places that have an effect... but I don't get around much, so don't know. This changes everything.
Amended on Sat 10 Apr 2010 01:11 AM by Windmill_Man
Australia Forum Administrator #19
Well turn the mapper off, and then copy and paste the normal map (the thing the trigger is matching on) so Twisol can see what it might be.
USA #20
Well. The output from MAP doesn't seem any different than normal MAP outputs:

Note: This is the first room in the Chrysalis Basilica that does it.

map
--- Area 19: Shallam ------------------------
              |       |       | 
              |       |       | 
              |       |       | 
     [ ]- - -[ ]- - -[ ]- - -[ ]-
              |       |       | 
              |       |       | 
              |       |       | 
             [ ]     [ ]     [ ]
                      | 
                      | 
                      | 
                     [+]
                      | 
                      | 
                      | 
                     [ ]
                      | 
                      | 
                      | 
                     [ ]
                      | 
                                             
                                             
--- A light-filled vestibule ----- 0:-8:0 ---


I decided to post the output from LOOK as well:

look
A light-filled vestibule.
This room is bathed with light, allowing natural luminance to pour in from 
huge, glass panes set into the ceiling. Giant pillars of white marble rise from
the floor to meet them, supporting the chamber yet still artfully placed to 
enhance the light. The polished floor has a similar effect, vaguely reflecting 
its surroundings, though a central design breaks the smooth, mirrored surface. 
Formed from clear glass, it appears to have shattered in a spiral pattern, yet 
some force deliberately preserves the delicate cracks therein. The four tenets 
of the church are scribed around it, gold writing out the words strength, 
faith, integrity, and spirit. A runic totem is planted solidly in the ground. 
Lying flat on the ground is a key-shaped sigil.
You see exits leading north and south (open door).


I'll post the results from Shastaan in a minute.
USA #21
Ok. This is from the first room in Shastaan that does it:

--- Area 33: The Southern Wilderness --------
                        \   \   \         | 
                         [ ] [ ] [ ]     [ ]
                          | \   /       /
                         [ ] [ ] [ ] [ ]
                          |   |   |   | 
                     [S]-[S]-[ ]-[ ]-[ ]-[ ]-
                          |       |   | 
                         [ ]     [@] [S]
                                  | 
                         [ ]-[ ]-[ ]
                        /
            -[ ]-[_]-[+]
                                             
                                             
                                             
                                             
                                             
                                             
                                             
                                             
                                             
                                             
                                             
--- Well-used track --------------- 2:0:0 ---


And the LOOK output as well:

Well-used track (road).
The bright sun shines down, blanketing you with its life-giving warmth. This 
path twists and winds through the changing landscape. By the look of the 
vegetation this path is well used, both by animals and people. Smoke from the 
village Shastaan hangs in the air. Crickets chirp in the grass at your feet and
butterflies flutter from wildflower to wildflower, drinking the sweet nectar. 
An ornate fishing pole of dark-hued wood lies here, separated from its creator.
You see exits leading northeast and west.


It seems to react within the entire area of Shastaan, but with the Basilica it seems to only react with certain rooms.
Australia Forum Administrator #22
Well I think I found it, sigh.

In the file reflexes/map.lua are these lines:


trigger["coordline"] {
  match   = [[^\-+(?: [A-Za-z'&quot;-_ ]+ )?(?:\-+)?(?: -?\d+:-?\d+:-?\d+ )\-+$]],
  enabled = false,
  regexp  = true,
  group   = "parsemap",


However this is wrong on two counts ...

  • The &quot; shouldn't be there - this isn't XML
  • The hyphen in the regexp should have \ in front of it


The sequence ";-_" in the regexp is matching any character between ";" and "_" (but not matching the hyphen - that means "between this and that"). The room name "Well-used track" has a hyphen in it.

Change it to read:


trigger["coordline"] {
  match   = [[^\-+(?: [A-Za-z'"\-_ ]+ )?(?:\-+)?(?: -?\d+:-?\d+:-?\d+ )\-+$]],
  enabled = false,
  regexp  = true,
  group   = "parsemap",

Amended on Sat 10 Apr 2010 02:18 AM by Nick Gammon
Australia Forum Administrator #23
Windmill_Man said:

It seems to react within the entire area of Shastaan, but with the Basilica it seems to only react with certain rooms.


Rooms with hyphens in the name perhaps? Like your two examples? Or with quotes in the names?
Amended on Sat 10 Apr 2010 02:22 AM by Nick Gammon
USA #24
Works like a charm! Turns out there's more than one room in Shastaan named "Well-used track (road)". Many thanks to both of you!

I'm sorry if this ordeal was a bother...
Australia Forum Administrator #25
Ah, I don't think the regexp will pick up brackets. Might need to change it to:


 match   = [[^\-+(?: [A-Za-z'"\-_ \(\)]+ )?(?:\-+)?(?: -?\d+:-?\d+:-?\d+ )\-+$]],

USA #26
Oops! Excellent catch(es), Nick! It used to be XML, but I ported it to use my Reflex library instead.

Windmill Man: Not an ordeal at all, I'm glad we figured out what was wrong. I'll go fix the pattern and re-upload so nobody else has to deal with this. :)
USA #27
Well. It was working fine, but I'll go ahead and change it just to make sure. Thanks again!
USA #28
Windmill_Man said:

Well. It was working fine, but I'll go ahead and change it just to make sure. Thanks again!


Oh, no, I haven't updated it yet *laughs*. I didn't mean I wanted you to update, you've already got it patched thanks to Nick. I just wanted to make a note that I'd be uploading a fix for anyone who wants to use it in the future.
USA #29
I was replying to Nick's last post actually. *grin*
USA #30
Oh. >_>
USA #31
Hmm... it seems like the plugin also has trouble with roomnames that have commas...

Also. I made a change with "main.lua" file in the script folder. I made it to where in/out and up/down exits have there own characters so that it's possible to tell them apart from the normal rooms that use the pound character. I think it's pretty cool. Now I could probably do without the compass.

I also have Nick's mapper running with your mapwindow plugin so that I have access to some of the feature it has and so I can use it as a backup or for when the room isn't mapped. Though, for some reason or another, I can't right click on rooms with Nick's plugin. Gives me an error. Also, I mentioned before that the mapper considers ALL rooms to be in the same area (area 0). I saw the screenshots of it in the "Achaea mapper" thread and saw that it listed the area names correctly... so I don't know what's up with mine. This could probably go in another thread though...
Australia Forum Administrator #32
You're going to have to add a comma to the list then:


 match   = [[^\-+(?: [A-Za-z'"\-_ \(\),]+ )?(?:\-+)?(?: -?\d+:-?\d+:-?\d+ )\-+$]],


As for the error, what was it exactly?
Amended on Sat 10 Apr 2010 11:17 AM by Nick Gammon
USA #33
This is it.

Error number: 0
Event:        Run-time error
Description:  [string "Plugin"]:871: bad argument #1 to 'WindowInfo' (string expected, got nil) stack traceback: 	[C]: in function 'WindowInfo' 	[string "Plugin"]:871: in function 'room_click' 	D:\Games\MUSHclient\lua\mapper.lua:261: in function <D:\Games\MUSHclient\lua\mapper.lua:253>
Called by:    Function/Sub: mapper.mouseup_room called by Plugin ATCP_Mapper Reason: Executing plugin ATCP_Mapper sub mapper.mouseup_room


EDIT: By the way... I would have added the comma myself... but I can't tell what's going on with that line. :P
Amended on Sat 10 Apr 2010 02:46 PM by Windmill_Man
USA #34
Windmill_Man said:
Also. I made a change with "main.lua" file in the script folder. I made it to where in/out and up/down exits have there own characters so that it's possible to tell them apart from the normal rooms that use the pound character. I think it's pretty cool. Now I could probably do without the compass.


Slick. I should have thought of that. *laughs* My plan was to add an overlay of up/down/in/out symbols on top of each room, but I didn't get around to it. Your approach is probably smarter though: since each room on the MAP can only have one symbol for information at a time, there's not much point, because you'd never have more information besides a symbol and a color to display.


Windmill_Man said:
EDIT: By the way... I would have added the comma myself... but I can't tell what's going on with that line. :P

Nick Gammon said:

match   = [[^\-+(?: [A-Za-z'"\-_ \(\),]+ )?(?:\-+)?(?: -?\d+:-?\d+:-?\d+ )\-+$]],


To break it down:

pattern ::= <dashes> <room nane> <dashes>? <coordinates> <dashes>
dashes ::= (?:\-+)
room name ::= (?: [A-Za-z'"\-_ \(\),]+ )?
coordinates ::= (?: -?\d+:-?\d+:-?\d+ )

Since the room name characters are clearly so hard to pin down, I'd try just using this instead:

room name ::= (?: .+? )?

One or more of any character, non-greedy match, whole thing optional. That comes out to:

^\-+(?: .+? )?(?:\-+)?(?: -?\d+:-?\d+:-?\d+ )\-+$
Amended on Sat 10 Apr 2010 07:05 PM by Twisol
USA #35
Yeah. You've done good. The map is more compact because you took the brackets out, which makes it nicer as a mini window because I think it might make it more "mini". Anyways, I had to make up/down as U/D because the underscore looked weird (it just looked like more of the lines between the rooms) without the brackets. I was wondering if there was a upside down caret or maybe some arrows I could use... but I didn't find any. "U" and "D" look good though. The in/out exits are still represented as "<" and ">" too.

Yeah. That line is less confusing. I'll see if there's a difference in performance between the two later. Thanks!
USA #36
Windmill_Man said:
I was wondering if there was a upside down caret or maybe some arrows I could use...


Could use 'v', couldn't you? ^v<>

I hope you're putting my translation tables (color and symbol) to good use. :)
USA #37
Oh man... I never thought of using "v"... I'll try that.
#38
Hey Twisol, I got your gauges plugin off of your site and have been trying to get it to run off of Nick's ATCP plugin, since it is what the new mapper runs off of...and I'm having a lot of trouble getting into your work and figuring out what is going on. Could you point out what exactly I'd have to change to get it to work?