[Home] [Downloads] [Search] [Help/forum]


Register forum user name Search FAQ

Gammon Forum

[Folder]  Entire forum
-> [Folder]  MUSHclient
. -> [Folder]  Plugins
. . -> [Subject]  MUSHclient generic graphical mapper module

MUSHclient generic graphical mapper module

It is now over 60 days since the last post. This thread is closed.     [Refresh] Refresh page


Pages: 1  2  3 4  5  6  7  8  9  10  11  12  13  14  15  16  17  

Posted by Techno Samurai   (5 posts)  [Biography] bio
Date Reply #30 on Wed 17 Mar 2010 05:39 PM (UTC)
Message
What do I do with the mapper.lua file?
[Go to top] top

Posted by Larkin   (278 posts)  [Biography] bio
Date Reply #31 on Wed 17 Mar 2010 05:41 PM (UTC)
Message
When you install MUSHclient 4.51, mapper.lua is installed into the 'lua' sub-directory for you. It's part of the distribution now.
[Go to top] top

Posted by Techno Samurai   (5 posts)  [Biography] bio
Date Reply #32 on Wed 17 Mar 2010 06:20 PM (UTC)
Message
Ok I'm still having problems. I downloaded 4.51.

======================================================
require "mapper"

mapper.init { config = config, get_room = get_room, show_help = OnHelp, room_click = room_click }
mapper.mapprint (string.format ("MUSHclient mapper installed, version %0.1f", mapper.VERSION))
======================================================

Is this what needs to go into an xml plugin? I'm so confused.
[Go to top] top

Posted by Larkin   (278 posts)  [Biography] bio
Date Reply #33 on Wed 17 Mar 2010 06:23 PM (UTC)
Message
That's only the start of it. There are functions and triggers you need to supply that tell the mapper when you've detected a room, the exits, terrain, etc.

This mapper module is generic and useful for storing and manipulating the map data, but it's left as an exercise to the end user (with help, of course) to make it work for your particular setup.
[Go to top] top

Posted by Techno Samurai   (5 posts)  [Biography] bio
Date Reply #34 on Wed 17 Mar 2010 07:27 PM (UTC)
Message
Ok well I tried making that plug-in and I received an error messege.

========================================================
C:\Program Files\MUSHclient\lua\mapper.lua:1107: No 'config' table supplied to mapper.
stack traceback:
[C]: in function 'assert'
C:\Program Files\MUSHclient\lua\mapper.lua:1107: in function 'init'
[string "Plugin"]:154: in main chunk
========================================================
[Go to top] top

Posted by Larkin   (278 posts)  [Biography] bio
Date Reply #35 on Wed 17 Mar 2010 07:29 PM (UTC)
Message
Try config = {} instead, to use the default configuration.
[Go to top] top

Posted by Nick Gammon   Australia  (22,975 posts)  [Biography] bio   Forum Administrator
Date Reply #36 on Wed 17 Mar 2010 08:04 PM (UTC)
Message
As an example of the mapper plugin, see the one I wrote for the ATCP-enabled MUDs (eg. IRE games, like Aetolia, Achaea, Imperian):

http://github.com/nickgammon/plugins/blob/master/ATCP_Mapper.xml

If you are playing one of those it should just work. If not, you can use it as a guideline. It saves rooms to a SQLite3 database for future use. It also uses the ATCP_NJG plugin to grab the ATCP data from the MUD.

There is an example config table you could borrow from it at the very least.

- Nick Gammon

www.gammon.com.au, www.mushclient.com
[Go to top] top

Posted by Techno Samurai   (5 posts)  [Biography] bio
Date Reply #37 on Thu 18 Mar 2010 01:47 PM (UTC)
Message
Thanks Nick, I'll see if I can get this working for the CircleMUD I'm playing.
[Go to top] top

Posted by Larkin   (278 posts)  [Biography] bio
Date Reply #38 on Fri 19 Mar 2010 01:55 AM (UTC)
Message
Lusternia is just getting around to adding some of the newer ATCP messages, but I have managed to get a slightly modified version of the mapper module to work with my settings.

I'm not sure of a couple things yet, though.


  1. How do I add a new area and set the area for any particular room?
  2. Is there any mechanism for setting up a special exit such that it links to a particular room? The ATCP doesn't cover special exits too well yet, which will hopefully change in the future.
  3. How do I set the colors for the various terrain types? I found a function for editing the colors, and it looks like it's called by the right-click callback, but the room_click function throws an error:

Run-time error
Plugin: Mapper (called from world: Test)
Function/Sub: mapper.mouseup_room called by Plugin Mapper
Reason: Executing plugin Mapper sub mapper.mouseup_room
[string "Plugin"]:867: bad argument #1 to 'WindowInfo' (string expected, got nil)
stack traceback:
        [C]: in function 'WindowInfo'
        [string "Plugin"]:867: in function 'room_click'
        .\mapper.lua:261: in function <.\mapper.lua:253>
Error context in script:
 863 :     tf [v.name] = v.func
 864 :   end -- for
 865 :       
 866 :   local choice = WindowMenu (mapper.win, 
 867*:                             WindowInfo (mapper.win, 14), 
 868 :                             WindowInfo (mapper.win, 15), 
 869 :                             table.concat (t, "|"))
 870 :    
 871 :   local f = tf [choice]
[Go to top] top

Posted by Nick Gammon   Australia  (22,975 posts)  [Biography] bio   Forum Administrator
Date Reply #39 on Fri 19 Mar 2010 02:25 AM (UTC)
Message
I've just uploaded to Git the latest changes in case you are out of sync with them.

I think for that particular message you need to go into the mapper.lua module and make "win" not be local.

Larkin said:

1. How do I add a new area and set the area for any particular room?


There is no present mechanism for adding areas. The workaround is to either use the sqlite3.exe command-line program and a bit of SQL, or one of the SQLite3 GUI editor programs (see their site) to maybe do it a bit more easily.

The SQL would need to look like:


INSERT INTO areas (uid, name, date_added) VALUES ('1234', 'Area name', DATETIME('NOW'))


Larkin said:

2. Is there any mechanism for setting up a special exit such that it links to a particular room? The ATCP doesn't cover special exits too well yet, which will hopefully change in the future.


The right-click mechanism lets you add exits, however only to the known directions.

Larkin said:

3. How do I set the colors for the various terrain types? I found a function for editing the colors, and it looks like it's called by the right-click callback, but the room_click function throws an error:


Once you get that fixed terrain-colour editing should work OK.

- Nick Gammon

www.gammon.com.au, www.mushclient.com
[Go to top] top

Posted by Larkin   (278 posts)  [Biography] bio
Date Reply #40 on Fri 19 Mar 2010 02:33 AM (UTC)
Message
I've got several ideas for improvements and tweaks (still want the user-configurable exit lengths), but it's a matter of having the time and patience. Once I got it installed and functioning, I was pretty impressed with what I saw.

Thanks for the scripts and tips!
[Go to top] top

Posted by Nick Gammon   Australia  (22,975 posts)  [Biography] bio   Forum Administrator
Date Reply #41 on Fri 19 Mar 2010 02:49 AM (UTC)
Message
I'm sure it can be improved, but it's a start. Suggestions welcome. Take not of the options at the file start:


<!DOCTYPE muclient [
  <!ENTITY show_vnums "true" > 
  <!ENTITY show_timing "false" > 
  <!ENTITY show_completed "false" > 
  <!ENTITY show_database_mods "true" > 
  <!ENTITY show_other_areas "false" > 
  <!ENTITY show_area_exits "true" > 
  <!ENTITY speedwalk_prefix "" > 
]>


They are intended as an easy way of customizing it, however the problem is such changes are global to all worlds, where you might want one to show other areas, and one not. Oh well, future enhancement.

The speedwalk_prefix option is a new idea suggested by Lasher. If non-empty, it does a fast speedwalk rather than waiting for each room change. So in the case of Aardwolf you might make it "run".

Another new option is "show_area_exits" - which if true draws a circle over the nearest room that goes to another area. Effectively this lets you know "how to leave the zone".

- Nick Gammon

www.gammon.com.au, www.mushclient.com
[Go to top] top

Posted by Larkin   (278 posts)  [Biography] bio
Date Reply #42 on Fri 19 Mar 2010 12:58 PM (UTC)
Message
I think the logic for when to draw stub exits is incorrect, but I'm unable to tweak and test at this very moment. I noticed last night, however, that even on a small, orthogonal map, it showed stub exits when it should just be showing the full line.

I think that line 692 should look like this instead, maybe:
(drawn [exit_uid] and drawn [exit_uid].coords ~= next_coords) then



I would really like to see database handler functions for the areas, such that the area could be set for a room manually or from a trigger. If an area doesn't exist yet, it needs to be added to the areas table and then it can be set as the area for a room, obviously. While walking around mapping then, you use the current_area (name or id?) for each room you create. So, if you walk into a new area and check SURVEY to get the area name, that becomes your new area for rooms you create, unless you walk back into an area you have mapped and continue there, then you take the area name from the already mapped rooms you pass through. (Hope that makes sense!)

I'm also very interested in variable length exit lines, which I realize is probably a lot easier in ASCII mapping than miniwindow mapping.

The up/down/in/out exits being drawn in ne/nw/se/sw directions isn't always practical or preferred, so an option to draw little symbols like up/down triangles or just the different colored edges would be nice.
[Go to top] top

Posted by Twisol   USA  (2,257 posts)  [Biography] bio
Date Reply #43 on Fri 19 Mar 2010 05:48 PM (UTC)
Message
Larkin said:
I think the logic for when to draw stub exits is incorrect, but I'm unable to tweak and test at this very moment. I noticed last night, however, that even on a small, orthogonal map, it showed stub exits when it should just be showing the full line.

I think that line 692 should look like this instead, maybe:
(drawn [exit_uid] and drawn [exit_uid].coords ~= next_coords) then

I'm pretty sure this has been fixed for several days now; I ran around the Eastern Ithmia in Achaea to create a map, and I noticed it too, but I mentioned it to Nick and he had already pushed a fix to GitHub an hour before. All three of us independently came up with the same solution, though, which is a good sign! ;)

'Soludra' on Achaea

Blog: http://jonathan.com/
GitHub: http://github.com/Twisol
[Go to top] top

Posted by Larkin   (278 posts)  [Biography] bio
Date Reply #44 on Fri 19 Mar 2010 05:50 PM (UTC)
Message
Looking at the latest mapper.lua on GitHub, it doesn't appear fixed to me. Am I missing something?
[Go to top] top

The dates and times for posts above are shown in Universal Co-ordinated Time (UTC).

To show them in your local time you can join the forum, and then set the 'time correction' field in your profile to the number of hours difference between your location and UTC time.


685,425 views.

This is page 3, subject is 17 pages long:  [Previous page]  1  2  3 4  5  6  7  8  9  10  11  12  13  14  15  16  17  [Next page]

It is now over 60 days since the last post. This thread is closed.     [Refresh] Refresh page

Go to topic:           Search the forum


[Go to top] top

Quick links: MUSHclient. MUSHclient help. Forum shortcuts. Posting templates. Lua modules. Lua documentation.

Information and images on this site are licensed under the Creative Commons Attribution 3.0 Australia License unless stated otherwise.

[Home]


Written by Nick Gammon - 5K   profile for Nick Gammon on Stack Exchange, a network of free, community-driven Q&A sites   Marriage equality

Comments to: Gammon Software support
[RH click to get RSS URL] Forum RSS feed ( https://gammon.com.au/rss/forum.xml )

[Best viewed with any browser - 2K]    [Hosted at HostDash]