Register forum user name Search FAQ

Gammon Forum

Notice: Any messages purporting to come from this site telling you that your password has expired, or that you need to verify your details, confirm your email, resolve issues, making threats, or asking for money, are spam. We do not email users with any such messages. If you have lost your password you can obtain a new one by using the password reset link.

Due to spam on this forum, all posts now need moderator approval.

 Entire forum ➜ MUSHclient ➜ Plugins ➜ Mapper Woes

Mapper Woes

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


Pages: 1  2 

Posted by Lmclarke   (26 posts)  Bio
Date Reply #15 on Sun 14 Jan 2018 10:06 PM (UTC)
Message
ti-legacy.com port 5050

You add the vnum into the prompt with the %R variable!
Top

Posted by Nick Gammon   Australia  (23,158 posts)  Bio   Forum Administrator
Date Reply #16 on Mon 15 Jan 2018 02:01 AM (UTC)

Amended on Tue 16 Jan 2018 04:17 AM (UTC) by Nick Gammon

Message
To get you started I have done a preliminary mapper for The Inquisition.

For this to work I changed my prompt to:


prompt {c{[RPXP Gain: %X] {[HP:%h MV:%v P:%p] %f %o{x (vnum %R) %c


Basically that is the standard prompt with "(vnum %R)" at the end. If you have a different prompt you'll need to change the prompt trigger. It also assumes that the vnum is wildcard #6 on the prompt trigger. If not change the "6" in the plugin to be whatever wildcard your vnum is.


uid = wildcards [6]


I have moved the source code to GitHub:

Template:saveplugin=Inquisition_Mapper To save and install the Inquisition_Mapper plugin do this:
  1. Go to the GitHub page: Inquisition_Mapper.xml
  2. Select all the page and copy it to the Clipboard
  3. Open a text editor (such as Notepad) and paste the plugin into it
  4. Save to disk on your PC, preferably in your plugins directory, as: Inquisition_Mapper.xml
  5. Go to the MUSHclient File menu -> Plugins
  6. Click "Add"
  7. Choose the file Inquisition_Mapper.xml (which you just saved in step 4) as a plugin
  8. Click "Close"

The main GitHub page for this plugin is at: https://github.com/nickgammon/plugins/blob/master/Inquisition_Mapper.xml.

There you will find the commit history and other information.




Example of it in use after a bit of wandering around:



Basically it detects room names, vnums, descriptions, and exits. You could add in more stuff (eg. shops) with a bit more work. There is also an alias "mapper find xxx" which does a simple search of room names. For example:


mapper find baker


This returns (for me):


Synthia's Bakery - 6 rooms away
A Lounge in the Bakery - 7 rooms away


[EDIT]

Caveats for use


The detection of which rooms leads to which depends on detecting that you type a movement command (eg. "n"), that your room number (vnum) changes, therefore that room A leads to room B by the direction you used. It also assumes that B leads back to A by the inverse direction (so if you go north to get to B, you go south to get back to A).

If you type multiple directions (ie. try to speedwalk) then it will get confused as the later direction will be considered the one which took you to the room.

So, for walking around mapping, type a single direction and then wait until you arrive. You can however "speedwalk" using the mapper (you can do this by clicking on any room in the map, or by using the "mapper find" command and clicking on a hyperlink).

Movement done by the mapper is "paced" so that it waits until you change rooms before sending the next movement command. Therefore it is fine to use the mapper speedwalk to get as quickly as you can from parts of the existing mapped rooms to a starting point for doing more mapping.

Prompts and output format


I tested this plugin with the default settings for a new character, except I modified the prompt as described above to show the vnum. If you have a modified prompt, or your prompt changes, you will probably need to change the trigger that matches the prompt (the line with the vnum). You could possibly have multiple triggers that match multiple prompt lines (for example, an in-combat line and an out-of-combat line). Multiple triggers will not be a problem, as they can all call the same script function.

I also detected a few special lines, which may possibly be drawn differently if you change your character configuration. In particular:


  • The prompt, naturally, which conveys the vnum. You don't have to use the word "vnum" in your prompt, possibly something else like "$$$12345$$$" would be less intrusive. If you change that, change the appropriate trigger match text.
  • The "new room" message which is bold text, in red text on a black background
  • The "weather" line which is also bold red text on a black background, and starts with a square bracket
  • A blank line after the room description (which itself follows the "weather" line, and separates the description from other things like "Dark clouds loom on the horizon" which are not part of the room description.
  • The "exits" line which reveals which exits the room has (which is used to pre-seed the available exits). This is in not bold, cyan text on a black background.
  • A couple of lines which indicate you are resting or asleep, if you try to move when in those states. I presume there would be other, similar one. So far they have appeared in bold yellow on black. There is a table of such messages (see below) which you can add to.


If you don't see anything much happening in the mapper review your configuration, or change the triggers to match how you have your game experience set up.

Debugging information


When a new room is added to the database you should see a line in your output window, in green, like this:


Added room <Entrance to the Merchants' Guildhall> (vnum 3403) to the mapper database


If that is annoying you can "comment out" (or delete) this line in the code:


    mapper.mapprint (string.format ("Added room <%s> (vnum %s) to the mapper database", room_name, uid))


You can "comment out" a line by putting "--" at the start of that line.


Things that prevent you from moving


Certain conditions (like resting, sleeping, etc.) prevent you from moving. The mapper needs to know what those messages are, otherwise it thinks you are moving and won't let you move somewhere else. Inside the plugin is a table of such messages, like this:


local cannot_move_messages = {
    "Nah... * feels too relaxed...",
    "In * dreams, or what?",

-- add more here

    }


To add more just add more lines like the above, using "*" as a wildcard if necessary (eg. instead of your name). If you find the mapper thinks you are walking when you aren't, type "mapper stop" to cancel the current speedwalk. You can also use "mapper stop" if you have started speedwalking and change your mind.

Once you have added more messages reload the plugin (File menu -> Plugins -> choose the Mapper plugin -> click "Reinstall"). If there are some other standard messages you are welcome to let me know what they are (copy and paste please!) so that updated versions of the plugin will include them.

Getting help


Type: "mapper help" for a quick summary of commands that can be used to talk to the mapper.

- Nick Gammon

www.gammon.com.au, www.mushclient.com
Top

Posted by Nick Gammon   Australia  (23,158 posts)  Bio   Forum Administrator
Date Reply #17 on Mon 15 Jan 2018 02:27 AM (UTC)

Amended on Mon 15 Jan 2018 02:28 AM (UTC) by Nick Gammon

Message
For simplicity the plugin serializes the mapper data to the plugin save file. This means it is retained from one session to the next, although there is a slight possibility you might lose the data if the power fails while the save file is being written out. You might want to back up the plugin "save state" file from time to time (eg. daily).

To find the save state file name, RH-double-click the plugin in the list of plugins dialog box.

- Nick Gammon

www.gammon.com.au, www.mushclient.com
Top

Posted by Lmclarke   (26 posts)  Bio
Date Reply #18 on Mon 15 Jan 2018 02:37 AM (UTC)

Amended on Mon 15 Jan 2018 03:31 AM (UTC) by Lmclarke

Message
Thank you so much for your (above and beyond) help with this. I'm going to keep at it and see if I can't whip together some of the excess features you referenced in the mapper guide, and suffice to say I would not have been able to get to do that without the above. Thank you, again! I'm so excited to try it out.
Top

Posted by Nick Gammon   Australia  (23,158 posts)  Bio   Forum Administrator
Date Reply #19 on Mon 15 Jan 2018 04:57 AM (UTC)
Message
Have fun playing!

I've enhanced it a bit since my earlier post:


  • It now captures room descriptions which show up if you hover the mouse over a room.
  • You can search for the contents of a room description (eg. "mapper find shop" where "shop" is in the description)
  • Added a few utility aliases like zooming in and out (which you could bind to a macro key)
  • Added "mapper goto xxx" which lets you go to a vnum
  • Added "mapper where xxx" which tells you the speedwalk to take to get from where you are to the nominated vnum
  • Added "mapper hide" and "mapper show" to temporarily hide or show the map
  • Added "mapper stop" to cancel speedwalking
  • Added detection that you are resting or asleep. You may need to add more of those, just follow the guidelines for the current triggers.
  • Added a notice when you load it about what the name of the "save state" file is so you know what file to back up regularly.

- Nick Gammon

www.gammon.com.au, www.mushclient.com
Top

Posted by Nick Gammon   Australia  (23,158 posts)  Bio   Forum Administrator
Date Reply #20 on Mon 15 Jan 2018 06:07 AM (UTC)
Message
I moved the plugin source to Github (link in earlier post). This makes it easier to keep track of changes.

You can also see the gradual development of the plugin by looking at the commit history. The initial commit was 335 lines, and the current version is 635 lines.

A fair bit I copied and pasted from other similar mappers.

The early commits show a more minimal version, and the later commit show how you can gradually add extra stuff.

- Nick Gammon

www.gammon.com.au, www.mushclient.com
Top

Posted by Lmclarke   (26 posts)  Bio
Date Reply #21 on Mon 15 Jan 2018 05:32 PM (UTC)
Message
Fantastic! Thank you!
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.


63,370 views.

This is page 2, subject is 2 pages long:  [Previous page]  1  2 

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

Go to topic:           Search the forum


[Go to top] top

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