Achaea: Vadi Mapper capture window

Share your scripts and packages with other Mudlet users.
Ramiel
Posts: 15
Joined: Sat Apr 25, 2009 5:57 am

Achaea: Vadi Mapper capture window

Post by Ramiel »

Hi folks,

To create the window, I use the following in my init() function that is run whenever I connect.

Code: Select all

--Put your screen resolution in here
resolutionX = 1440
resolutionY = 900

createMiniConsole("mapcap", resolutionX-440, 0, 400, 350)
setBackgroundColor("mapcap", 20, 0, 0, 0 ) -- gives the background of the window a -slight- noticable color
This creates the window, and sets it to hug the right top corner of your buffer screen. The codes for setBackgroundColor go red, green, blue, opacity if you want to set a custom background color..

Next I have some triggers that detect the map, and then call this function:

Code: Select all

function cutMap()
	selectString(line, 1)
	cut()
	appendBuffer("mapcap")
end
Which then neatly cut and pastes it across into the mini console.

This ends up looking like the following:

Preview <-- clicky

I'm tidying this up into a package, will post it momentarily.
Attachments
vmap.xml
0.1.1 - no need to manually adjust the window size anymore + map autoloads
(6.6 KiB) Downloaded 1111 times

User avatar
Vadi
Posts: 5048
Joined: Sat Mar 14, 2009 3:13 pm

Re: Achaea: Vadi Mapper capture window

Post by Vadi »

I think the top line which says the room name and number is cut off a bit. Otherwise, great stuff!

User avatar
Heiko
Site Admin
Posts: 1548
Joined: Wed Mar 11, 2009 6:26 pm

Re: Achaea: Vadi Mapper capture window

Post by Heiko »

What about making the map clickable by forwarding click events and relative mouse positions as Lua events or to the mapper? Can the mapper do anything with this information e.g. show sub maps, overview maps etc? Does it have any other functions we could use?

User avatar
Vadi
Posts: 5048
Joined: Sat Mar 14, 2009 3:13 pm

Re: Achaea: Vadi Mapper capture window

Post by Vadi »

Clickable? It's already clickable for clients that support MXP - it makes rooms as an MXP link to have the client send a "goto #" command (along with a right-click menu on each room).

So adding MXP would be much more beneficial as I've added support for it in the mapper, rather than having Ramiel do a custom solution for Mudlet.

Ramiel
Posts: 15
Joined: Sat Apr 25, 2009 5:57 am

Re: Achaea: Vadi Mapper capture window

Post by Ramiel »

Yep, what he said.

MXP would be very handy.

User avatar
Heiko
Site Admin
Posts: 1548
Joined: Wed Mar 11, 2009 6:26 pm

Re: Achaea: Vadi Mapper capture window

Post by Heiko »

I'll be adding a really nice graphical mapper after 1.0 is out. That will be a much better solution.

User avatar
Vadi
Posts: 5048
Joined: Sat Mar 14, 2009 3:13 pm

Re: Achaea: Vadi Mapper capture window

Post by Vadi »

For mapping, maybe, lack of MXP, not really.

Veldrin
Posts: 4
Joined: Thu Jul 09, 2009 3:44 am

Re: Achaea: Vadi Mapper capture window

Post by Veldrin »

mine just looks weird, the link between rooms are either messed up or completely gone
vmap.png

User avatar
Vadi
Posts: 5048
Joined: Sat Mar 14, 2009 3:13 pm

Re: Achaea: Vadi Mapper capture window

Post by Vadi »

Yeah that does look quite weird. Not sure whats up with that. For better fonts though, enable "anti-aliasing" in main window settings.

User avatar
Heiko
Site Admin
Posts: 1548
Joined: Wed Mar 11, 2009 6:26 pm

Re: Achaea: Vadi Mapper capture window

Post by Heiko »

Ramiel's map plugin uses cut() and doesn't set a proper font size which may lead to proportinal fonts.
The cut() function has been depricated and is no longer supported.

From what I see this needs to be changed:
Note: the mini console font needs to be set to a size to suit the size of the map window. 10 may be too large.

Code: Select all

function init()
	resolutionX, resolutionY = getMainWindowSize()
	setMiniConsoleFontSize("mapcap", 10);
	createMiniConsole("mapcap", resolutionX-440, 0, 400, 350)
	setBackgroundColor("mapcap", 20, 0, 0, 0 )
end
and

Code: Select all

function cutMap()
	selectCurrentLine();
	copy()
	appendBuffer("mapcap")
	deleteLine();
end
I don't have this mapper/bot so I can't test this myself, but this should work.
Maybe you can repackage a working plugin and replace the original one. Also the modules should have a common name e.g. Ramiels vmap plugin. This way people can better uninstall or upgrade the plugin later.

Post Reply