[MOD] mtpoimap (Minetest Point-Of-Interest Map)

Post Reply
beaver700nh
New member
Posts: 8
Joined: Fri Oct 08, 2021 20:56
GitHub: beaver700nh
In-game: __mt_admin__ _q_a_z_w_s_x_

[MOD] mtpoimap (Minetest Point-Of-Interest Map)

by beaver700nh » Post

MTPOIMAP

A Minetest mod for displaying a map with points of interest, for any game (no dependencies).

You must have administrative powers to set up POI Maps, but anyone can use one. POI Maps are uncraftable and inaccessible from the creative inventory. They can be broken by hand or using an axe.

How to use

Put map images in textures/ and point-of-interest list files in pois/. Then use this command to get a POI Map:

Code: Select all

/giveme mtpoimap:mtpoimap
Once you do that, you can place it down and right-click it. This will open up the following dialog:

Image

In the first box, type a title for the map. This will be displayed when players hover over the map or when the map is opened. In the second box, type the name of the map file to use as the background. Do not type any directories or paths here, only the file name! Finally, in the third box, type the path to the POI list file, relative to the mod root directory. These files are usually stored in the pois/ directory. After filling in all the boxes, press enter. The POI map should update its hover text to whatever title you provided:

Image

Now right-click on the POI Map. You should see a dialog like this:

Image

Again note that the title you provided is displayed at the top. Also, the map image you provided should be displayed in the background of the dialog. Circle shaped icons should also appear according to what is listed in the provided POI list file. Hovering over these icons will display the hover text provided in the file. Finally, the "Reload" button in the top-right corner can be used to update the points on the map should the POI list file be modified after the POI map is set up.

POI List File Syntax

POI list files have a simple syntax. Each line corresponds to one point on the map, and has the following format:

Code: Select all

x_pos, y_pos | icon_color | Hover Text
x_pos and y_pos form a coordinate pair ranging from (-1, -1) which is the top left corner to (1, 1) which is the bottom right. (0, 0) is the center of the map. icon_color is a string which can have any of the following values:

Code: Select all

red
orange
yellow
green
blue
purple
violet
magenta
grey
gray
grey is an alias for gray and violet is an alias for purple. More icon colors can be added by adding more mtpoimap_poiicon_<COLOR>.png files in the textures/ directory.

Hover Text is any string that will be displayed as the tooltip when the point is hovered over. It may contain the escape sequences \r, \n and \t, which will be converted into their respective control characters. Double backslashes may be used to insert literal escape sequences into the tooltip. Percent signs may also be used in the hover text but backslashes preceding percent signs must be doubled to be shown in the tooltip.

GitHub: https://github.com/beaver700nh/mtpoimap

Yona
Member
Posts: 59
Joined: Sun Oct 01, 2023 21:37

Re: [MOD] mtpoimap (Minetest Point-Of-Interest Map)

by Yona » Post

Hi, very good mod, thank you!

Is there a way to zoom in formspec by set_pov/zoom_pov?

I can zoom to the node to see the map on the block closer but the formspec map no option to zoom, because if the map is very large it would be hard to tell the exact location.

Plus noticed that the formspec map is not the same pos z,y location as the node pos z,y,x location, but after i figured that out was able to position the dot on the formspec map close to the poi.


Screenshot_2023-10-16_08-08-58.png
Screenshot_2023-10-16_08-08-58.png (460.66 KiB) Viewed 854 times
Screenshot_2023-10-16_08-12-53.png
Screenshot_2023-10-16_08-12-53.png (455.53 KiB) Viewed 854 times

beaver700nh
New member
Posts: 8
Joined: Fri Oct 08, 2021 20:56
GitHub: beaver700nh
In-game: __mt_admin__ _q_a_z_w_s_x_

Re: [MOD] mtpoimap (Minetest Point-Of-Interest Map)

by beaver700nh » Post

Hi,

Funny to see that someone is actually using this mod. I made it a while ago for a server I don't play on much anymore... busy with life. Zooming the map would require some extra Lua trickery and I hardly know this language, so my apologies but I don't think I will be adding this. However, if there is any pull request then I will be happy to review and merge on some weekend.

Best,
beaver700nh

User avatar
Mantar
Member
Posts: 584
Joined: Thu Oct 05, 2017 18:46
Contact:

Re: [MOD] mtpoimap (Minetest Point-Of-Interest Map)

by Mantar » Post

It's probably doable with a scroll_container formspec block, display the image at a much larger size inside the block and allow the scrollbars to move around the map. Maybe a checkbox to toggle the zoomed-in vs zoomed-out version.
Lead dev of Exile, git repo: https://codeberg.org/Mantar/Exile

Yona
Member
Posts: 59
Joined: Sun Oct 01, 2023 21:37

Re: [MOD] mtpoimap (Minetest Point-Of-Interest Map)

by Yona » Post

Mantar wrote:
Tue Oct 17, 2023 17:42
It's probably doable with a scroll_container formspec block, display the image at a much larger size inside the block and allow the scrollbars to move around the map. Maybe a checkbox to toggle the zoomed-in vs zoomed-out version.
Yeah scroll_container might work, would also need scrollbar and scrollbaroptions.

Yona
Member
Posts: 59
Joined: Sun Oct 01, 2023 21:37

Re: [MOD] mtpoimap (Minetest Point-Of-Interest Map)

by Yona » Post

Mantar wrote:
Tue Oct 17, 2023 17:42
It's probably doable with a scroll_container formspec block, display the image at a much larger size inside the block and allow the scrollbars to move around the map. Maybe a checkbox to toggle the zoomed-in vs zoomed-out version.

Well the scroll_container with scrollbar and scrollbaroptions is in but still need to rework code for larger images and add horizontal scrollbar to scroll ver and hor.

Still working on some errors "Invalid scroll_container end element, no matching scroll_container start element."
Screenshot from 2023-10-18 10-05-13.png
Screenshot from 2023-10-18 10-05-13.png (523.72 KiB) Viewed 723 times
Screenshot from 2023-10-18 10-20-18.png
Screenshot from 2023-10-18 10-20-18.png (533.37 KiB) Viewed 723 times

Post Reply

Who is online

Users browsing this forum: No registered users and 19 guests