Magic Map for Mudlet 3

Need some help with your MUD client? Forgot your password? Get help here.
Forum rules
- Use common sense and be respectful towards each other at all times, even when disagreeing.
- Do not reveal sensitive game information. Guild secrets, player seconds are examples of things not allowed.
Findis
Greenhorne
Posts: 6
Joined: 03 Jun 2017 00:38

Magic Map for Mudlet 3

Post by Findis » 03 Jun 2017 20:29

There have been a few people asking about clients that support the magic map and I decided to develop a script for mudlet that solves this issue. The magic map for mudlet is nothing spectacular (I am not a UI designer), but it seems to work. I will continue to post any updates/changes I make to the script while I still roam the realms, so if you find any problems, or have any change suggestions, let me know!

To install the Magic Map on Mudlet, load your Mudlet profile, click "Package Manager" on the top menu, click the "Install" button, and select the zip file attached to this post. Restart Mudlet if it does not show up right away.

Hope this proves useful to a person or two!
Findis!
Attachments
MagicMap20170602.zip
Initial release of the Magic Map for Mudlet
(1.24 KiB) Downloaded 145 times
Last edited by Findis on 03 Jun 2017 20:36, edited 1 time in total.

Zugzug
Veteran
Posts: 233
Joined: 20 May 2017 15:25

Re: Magic Map for Mudlet 3

Post by Zugzug » 03 Jun 2017 20:34

Findis wrote:There have been a few people asking about clients that support the magic map and I decided to develop a script for mudlet that solves this issue. The magic map for mudlet is nothing spectacular (I am not a UI designer), but it seems to work. I will continue to post any updates/changes I make to the script while I still roam the realms, so if you find any problems, or have any change suggestions, let me know!

To install the Magic Map on Mudlet, load your Mudlet profile, click "Package Manager" on the top menu, click the "Install" button, and select the zip file attached to this post. Restart Mudlet if it does not show up right away.

Hope this proves useful to a person or two!
Findis!
You are THE. BEST.

Thank you very much!

palaver
Beginner
Posts: 21
Joined: 05 May 2017 23:59

Re: Magic Map for Mudlet 3

Post by palaver » 03 Jun 2017 22:40

Most excellent.
Hopefully this opens the door for some people to experiment.
With the map, Mudlet is giving me lots of joy.

Thanks, Findis!
"When I die, throw me to the wolves. I'm used to it."
- Diogenes the Cynic (trans. Davenport)

User avatar
Ody
Hero
Posts: 390
Joined: 18 Apr 2015 03:28
Location: Vingaard Keep

Re: Magic Map for Mudlet 3

Post by Ody » 04 Jun 2017 01:47

Excellent job, Findis.
All I am is your Van Gogh; I paint our dreams on the golden coast
I stay up high, flying solo; Don't come too close
I just ghost
I told you I am the new Poe; I sold my soul to the radio
I steal your heart in the shadows; Don't come too close
I just ghost

Findis
Greenhorne
Posts: 6
Joined: 03 Jun 2017 00:38

Re: Magic Map for Mudlet 3

Post by Findis » 04 Jun 2017 02:08

To give people an idea of what it looks like, here's a picture of my complete setup! It is definitely ugly, but now that it's functional, I'll take some time to make it look appealing.
Attachments
setup.png
setup.png (192.74 KiB) Viewed 2850 times
Last edited by Findis on 04 Jun 2017 18:43, edited 1 time in total.

User avatar
Tarax the Terrible
Myth
Posts: 1331
Joined: 09 Mar 2010 20:33
Location: UK

Re: Magic Map for Mudlet 3

Post by Tarax the Terrible » 04 Jun 2017 03:25

Loving your work.

Curious about something for a Cmud implementation.

Saw in the script you are using

Code: Select all

return end local x, y = tonumber(gmcp.room.info.x), tonumber(gmcp.room.info.y)
Does this have a map width and length?

Cus thats what you use to split it up.

Code: Select all

split(map, "\n") local myline = replace_char(x+1,maplines[y+1], "X") maplines[y+1] etc
Not on cMud or id just check instead of asking.
ty
http://genesisquests.pbworks.com/
Join up and help each other with Quests :)

Findis
Greenhorne
Posts: 6
Joined: 03 Jun 2017 00:38

Re: Magic Map for Mudlet 3

Post by Findis » 04 Jun 2017 07:15

Tarax the Terrible wrote:Loving your work.

Curious about something for a Cmud implementation.

Saw in the script you are using

Code: Select all

return end local x, y = tonumber(gmcp.room.info.x), tonumber(gmcp.room.info.y)
Does this have a map width and length?

Cus thats what you use to split it up.

Code: Select all

split(map, "\n") local myline = replace_char(x+1,maplines[y+1], "X") maplines[y+1] etc
Not on cMud or id just check instead of asking.
ty
Hi Tarax,

Hmm. the x and y values are the position that the charater is in on the map. Since the map sent through GMCP is a multiline string, I split the string into an array of strings everytime there is a newline ("\n"). Using maplines[y] returns the string of the row of the map that my character is located. After that, I use the replace the x-th character (which is usually an "o" on genesis maps) with a red "X" to make it easy to see where you are on the map... Look at the example I took from Greenhollow, below.

Code: Select all

  info = {
    zoomx = 19,
    x = 60,
    id = "PTwHB0",
    short = "in southern Greenhollow near the Adventurer's Guild",
    zoomy = 22,
    exits = {
      "west",
      "north",
      "east",
      "south"
    },
    doors = {
    },
    y = 14
  },
  map = {
    map = [[
                            __________
                          .' ________/  ` .              _____
                         /  /.       `.     ` .         /    / `.
                        .-./  `.       `.      /      .-----.     `.___
                       /   `.   `.       `.   //     /       `.   / \  /\
                      /  \\\ `.   /========`.//     /----------`./  / /  \
                     /=========`./\_________\/       \   \\\    \  / /   /
                      \    .    \  /                 /\__________\/ /   /
    Library            \___\|\___\/ The Inn         /______________/   /
         __                 |                       \  ==      ==  \  /
       //   `.              |                        \____\\\\\_____\/
      //     /\             |                Adventurer's   |
   __//     /_/             |                   Guild       |
  / //     /  /\            |                               |
 /_//     /__/\/-- -- -- -- o -- -- -- -- -- -- -- -- -- -- o -- -- -- -- -- 
 \/ `.   /\__\/             |                               |
 /    `./ /                 |         =============         |
 \______\/                  |          Village of           |
                     _______|__        Greenhollow          |
                    /_________/|\     (south side)          o
                    \_________\| |    =============         |
             Tavern  |__|\_\____\|                          |
                      \__| 
]],
In this case, x = 60 and y = 19. Now, if we split the map string by easy new line, then we get an array that looks like:

Code: Select all

{
  "                            __________",
  "                          .' ________/  ` .              _____",
  "                         /  /.       `.     ` .         /    / `.",
  "                        .-./  `.       `.      /      .-----.     `.___",
  "                       /   `.   `.       `.   //     /       `.   / \\  /\\",
  "                      /  \\\\\\ `.   /========`.//     /----------`./  / /  \\",
  "                     /=========`./\\_________\\/       \\   \\\\\\    \\  / /   /",
  "                      \\    .    \\  /                 /\\__________\\/ /   /",
  "    Library            \\___\\|\\___\\/ The Inn         /______________/   /",
  "         __                 |                       \\  ==      ==  \\  /",
  "       //   `.              |                        \\____\\\\\\\\\\_____\\/",
  "      //     /\\             |                Adventurer's   |",
  "   __//     /_/             |                   Guild       |",
  "  / //     /  /\\            |                               |",
  " /_//     /__/\\/-- -- -- -- o -- -- -- -- -- -- -- -- -- -- o -- -- -- -- -- ",
  " \\/ `.   /\\__\\/             |                               |",
  " /    `./ /                 |         =============         |",
  " \\______\\/                  |          Village of           |",
  "                     _______|__        Greenhollow          |",
  "                    /_________/|\\     (south side)          o",
  "                    \\_________\\| |    =============         |",
  "             Tavern  |__|\\_\\____\\|                          |",
  "                      \\__| "
}
Since we know that our y position is 19 (where the smallest y is 0) I take the line at y+1=20 because LUA arrays are NOT 0 based (so if cMud arrays are 0 based. you do not need to add 1 to y), which returns the following line:

Code: Select all

  " /_//     /__/\\/-- -- -- -- o -- -- -- -- -- -- -- -- -- -- o -- -- -- -- --
Again, since mudlet has 1 based arrays, I add one to the value of x again so that character 61 (which is a "o") in this case, is replace with an "X". Then, I simply append all the lines back together, and print it to a miniconsole. I do not own a copy of cMud, and there is not a version of it that runs on linux natively (which is my main operating system), so I can't assist you with cMud specific code, but I can help you with any algorithm specific questions you have.

User avatar
Hexen
Beginner
Posts: 12
Joined: 06 Dec 2016 23:20
Location: Minas Morgul

Re: Magic Map for Mudlet 3

Post by Hexen » 04 Jun 2017 08:25

Sick as fuck Findis.
,___,
[O,o]
/)''''/)
-"--"--
~Night Owl~
Slow death, immense decay... Showers that cleanse you of your life. Angel of Death! Monarch to the kingdom of the dead..Sadistic, surgeon of demise. Sadist of the noblest blood!

User avatar
gorboth
Site Admin
Posts: 2292
Joined: 03 Mar 2010 20:51
Location: Some old coffin

Re: Magic Map for Mudlet 3

Post by gorboth » 05 Jun 2017 00:10

This makes me smile. Impressive gains, Findis! You're developing a fan base, and no surprise. :-)

G.
Mmmmmm ... pie ...

User avatar
Dakhor
Apprentice
Posts: 31
Joined: 23 Sep 2016 16:21

Re: Magic Map for Mudlet 3

Post by Dakhor » 08 Jun 2017 11:57

Hiya!

For those that wish the map to be a floating and seperate window this is now made more easy with Mudlet 3.2 release and the function openuserwindow.

http://wiki.mudlet.org/w/Manual:UI_Func ... UserWindow

From the devs...

"
Would you like to make your miniconsoles separate from the Mudlet window? Move them over to another monitor perhaps? Or make dock them inside Mudlet? You can with openUserWindow(), check it out. This release has improved a lot of things for userwindows – they’ll now remember their position when you open Mudlet, won’t inherit borders from the main window, and will close with the profile. Once you open a userwindow, you can use all the same cecho(), copy(), paste() on it just as with a miniconsole.
"



Cheers

DaC

Post Reply
http://tworzymyatmosfere.pl/przescieradla-jedwabne-z-gumka/