[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 Nick Gammon   Australia  (22,973 posts)  [Biography] bio   Forum Administrator
Date Reply #165 on Tue 12 Oct 2010 01:55 AM (UTC)

Amended on Tue 12 Oct 2010 01:56 AM (UTC) by Nick Gammon

Message
Sounds like it isn't realizing you changed rooms and adding the exit to the room's exits list.

Try adding some debugging to fix_up_exit and OnPluginSent:


-- -----------------------------------------------------------------
-- We have changed rooms - work out where the previous room led to 
-- -----------------------------------------------------------------

function fix_up_exit ()

  -- where we were before
  local room = rooms [from_room]
  
  -- leads to here
  room.exits [last_direction_moved] = current_room
    
  print ("Fixing exit for", from_room, "to go to", current_room)

  -- clear for next time
  last_direction_moved = nil
  from_room = nil
  
end -- fix_up_exit

-- -----------------------------------------------------------------
-- try to detect when we send a movement command
-- -----------------------------------------------------------------

function OnPluginSent (sText)
  if valid_direction [sText] then
    last_direction_moved = valid_direction [sText]
    print ("Just moved", last_direction_moved)
    if current_room and rooms [current_room] then
      expected_exit = rooms [current_room].exits [last_direction_moved]
      if expected_exit then
        from_room = current_room
      end -- if
    -- print ("expected exit for this direction is to room", expected_exit)
    end -- if
  end -- if 
end -- function


Basically in order to draw interconnecting rooms, it has to know that room A has an exit (eg. east) that leads to room B.

Try with the debug lines in bold, and see if it is detecting your moving, and detecting the need to add an exit.

- Nick Gammon

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

Posted by forral   USA  (79 posts)  [Biography] bio
Date Reply #166 on Tue 12 Oct 2010 02:16 AM (UTC)

Amended on Tue 12 Oct 2010 02:26 AM (UTC) by Nick Gammon

Message
Nick,

Would you be able to elaborate as to how someone can customize this mapper to fit their particular MUD? For instance my full output of a room description, and prompt is:


The Dracon's Den                                       -      -      -
(-------------------------------------------------)     - <---(M)---> -
                                                        #      -      -

  As you enter this room, a warm breeze flows over you from the
fireplace.  You notice an enormous statue of Beyonder, the Dracon Guardian
of the Source on the mantelpiece.  Dark velvet drapes cover all the
windows, and a blood-red rug is draped across the stone floor.  A large
desk is positioned in the middle of the room, strewn with papers and various
artifacts.  Mounted heads can be seen above each window and the door,
leading you to believe the owner of this home is not someone to be trifled with.

[SAFE]<3087hp 2500sp 1730st> [AWAY][SAFE]<3087hp 2500sp 1730st> 



although obviously the compass is a bit distored with the copying/pasting.

How can I customize the mapper for this particular output? And how would I go about handling dizzy rooms, repeating rooms, teleport rooms, etc?

Thanks!!
Forral
[Go to top] top

Posted by Nick Gammon   Australia  (22,973 posts)  [Biography] bio   Forum Administrator
Date Reply #167 on Tue 12 Oct 2010 02:31 AM (UTC)
Message
You need to make a trigger that can detect the room description. That is the hard bit. Once made the room description can be hashed into a unique (hopefully) room code, which the mapper can then use.

It's hard to guess what yours might be without more room descriptions to look at, but the hyphens in brackets might help - are they always the same length?

- Nick Gammon

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

Posted by Nick Gammon   Australia  (22,973 posts)  [Biography] bio   Forum Administrator
Date Reply #168 on Tue 12 Oct 2010 02:38 AM (UTC)
Message
Is this Materia Magica? If so, Rebecca Madison earlier in this thread said she had worked out how to parse the room names. Perhaps you two should work together? It looks like the room names might be in yellow, that could help detect them.

- Nick Gammon

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

Posted by forral   USA  (79 posts)  [Biography] bio
Date Reply #169 on Tue 12 Oct 2010 03:07 AM (UTC)
Message
Nick Gammon said:

Is this Materia Magica? If so, Rebecca Madison earlier in this thread said she had worked out how to parse the room names. Perhaps you two should work together? It looks like the room names might be in yellow, that could help detect them.


Yes this is materia magica, and I don't know what her character name is so I wouldn't know who to contact.

Yes the (------------------) part of the description is always the same, that and the exits that are drawn in the virtual compass (there is one for up and down right next to that M in the middle)

[Go to top] top

Posted by Nick Gammon   Australia  (22,973 posts)  [Biography] bio   Forum Administrator
Date Reply #170 on Tue 12 Oct 2010 04:27 AM (UTC)
Message
See new thread:

http://www.gammon.com.au/forum/?id=10667

- Nick Gammon

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

Posted by Hunter Green   USA  (16 posts)  [Biography] bio
Date Reply #171 on Sun 17 Oct 2010 03:51 PM (UTC)
Message
Nick Gammon said:
The special exits: I have that as low priority so if you want to tackle it, that would be great.

Perhaps it's just because I don't know Lua or MUSHclient's plugin system yet, but I'm hazy on the question of which of these things on my "must have" list are things I could potentially do.

I can certainly see how I can add triggers that call the MAPPER command. When it comes to slightly more intrusive things, like adding a MAPPER WALK <bookmark> command, I can see (vaguely) how I could do it, but only by editing ATCP_Mapper -- and thus potentially making my version of it separate from yours, meaning I can no longer benefit from any changes you make or bugs you fix.

And when it comes to the biggies on my list, like special exits and splitting the database, I can't see how I can even begin to approach those without completely diverging from what you're doing. The biggest concern here: the XML map I can download from Lusternia has an incredible amount of useful information, is semi-regularly updated, and is invaluable; but as there are a few essential things not in it, I can't work from having nothing but it. I need a way to map other rooms, set room costs, and add special exits, and not have these overwritten every time I import an updated map, or the mapper is *useless* to me: I can't rely on something likely to take me into enemy territory, something that can't find the most useful paths or the rooms most important to my character.

Even assuming I could put in the time to learn Lua and MUSHclient well enough to handle things that big, is there really a way I could be making changes this deep without breaking off from the development stream?
[Go to top] top

Posted by Nick Gammon   Australia  (22,973 posts)  [Biography] bio   Forum Administrator
Date Reply #172 on Sun 17 Oct 2010 07:25 PM (UTC)
Message
In the current ATCP mapper I have two databases, one which is created from the XML, and one which is the "bookmarks" database which contains stuff you add (like bookmark a room because it has a quest in it). The idea of this was to keep your notes without losing them when you update the XML.

So if you added extra things you simply add them to the bookmark database (examples already in the code) and don't lose anything in the main database.

One way of adding extra features might be to have the main mapper load an "extras.lua" file which you could incorporate your extra code in, and then if the main mapper is updated it still loads your extras. Even if the official one doesn't have that in it (which it doesn't at present) that would be a way of keeping your changes in a separate file.

So you might put near the bottom of the mapper:


require "my_extras"


And then add that line back when a new version is released.

This doesn't totally address how extra aliases might be added, but that can be done with the XML "include" line which plugins support.

- Nick Gammon

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

Posted by Hunter Green   USA  (16 posts)  [Biography] bio
Date Reply #173 on Sun 17 Oct 2010 08:19 PM (UTC)
Message
It seems unlikely to me that superceding existing code is really a viable way of dealing with issues as fundamental as "rooms are in two databases, not one" or "path choosing depends on room/exit costs" because even if you could address those it seems you'd be replacing a lot of the core of the stuff you'd be trying to use.

I feel like I'm not really expressing my concern here, though, and I'm sure that's my fault, so I think I'll drop it until such time as I either decide to delve deeply enough into this to figure out the answer myself, or decide to go a different way entirely.
[Go to top] top

Posted by Nick Gammon   Australia  (22,973 posts)  [Biography] bio   Forum Administrator
Date Reply #174 on Sun 17 Oct 2010 08:26 PM (UTC)
Message
I have placed the mapper module and mapper plugins "out there" to inspire others to improve on them. For example recently I did a mapper for Materia Magica which was dissimilar enough to the ATCP one that I copied and pasted rather than trying to make one big, ugly one that did everything.

If you are addressing a particular MUD you may want to just try that - I'm a bit unlikely to make huge improvements in the future, especially as MUDs tend to be different. For example, some give room numbers, some don't. Some give coordinates, some don't. Trying to make an all-purpose mapper could just be ugly and convoluted.

A recent change I made (snippets in the full-text search) were minor enough that you just just retro-add them into your copy, if you wanted to.

- Nick Gammon

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

Posted by Hunter Green   USA  (16 posts)  [Biography] bio
Date Reply #175 on Sun 17 Oct 2010 08:50 PM (UTC)
Message
Nick Gammon said:
I have placed the mapper module and mapper plugins "out there" to inspire others to improve on them.

I suppose that's the real answer I was looking for, at least the unspoken part.
[Go to top] top

Posted by Ves   (8 posts)  [Biography] bio
Date Reply #176 on Tue 26 Oct 2010 06:53 PM (UTC)
Message
Has anyone gotten this to work for Ateraan? Was curious before I tried getting it to work.
[Go to top] top

Posted by AniaLilles   (3 posts)  [Biography] bio
Date Reply #177 on Sat 29 Oct 2011 05:49 PM (UTC)
Message
Hi...

I am an ordinary user, very new to MUDs, and the like, and I am not a coder.

I am attempting to play RPIs, which are not necessarily map-inclusive. BEing that I am visually and mentally challenged finding my way around even in the real world, I was looking for a way to use this. There is CMUD, but I'm also hoping to not pay. So I'm attempted to figure this out, but I am not succeeding.

I need a mapper that auto-maps a world as I walk it, assigning unique numbers that I may type a command like 'WALK <number>' and it'll go there. Or double-click on the map and it'd speedwalk me there. I thought this might fit the bill.

Please help. If anyone has this already converted as a generic plugin that'd be great. I have 30 days with CMUD to enjoy my games without worrying about my mapping needs, and then I have to decide whether to pay or -hopefully- go with MushClient.

I'd rather really go with MushClient.
[Go to top] top

Posted by AniaLilles   (3 posts)  [Biography] bio
Date Reply #178 on Sat 29 Oct 2011 05:51 PM (UTC)
Message
To explain, I've really tried looking at making the plugin. The plugin wizard sounds easy enough, but then I wondered on how to take the lua file and include it within the wizard, etc.

><
[Go to top] top

Posted by Nick Gammon   Australia  (22,973 posts)  [Biography] bio   Forum Administrator
Date Reply #179 on Sat 29 Oct 2011 08:49 PM (UTC)
Message
The tricky bit with any mapper is working out the current room ID or number. The mapper has to have some way of knowing when you have changed rooms, and assign some sort of identifier to each room, so it knows if you have been here before. If you have been there before it can then "remember" how you got there (eg. west from Main Street leads to Baker Shop).

Recently the mapper was adapted to run on Materia Magica, a MUD that doesn't have any obvious room numbers:

http://www.gammon.com.au/forum/?id=10667

Basically there I hashed together the room name, description and compass (ie. exits) to get a unique room code.

It's hard to be more helpful without seeing the MUD in question. Perhaps if you give a link to its IP/port we could see how easy it would be to adapt the mapper?

- Nick Gammon

www.gammon.com.au, www.mushclient.com
[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.


678,548 views.

This is page 12, 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]