dgm3333 / mapit Goto Github PK
View Code? Open in Web Editor NEWmapit - A mod to show a map of the minetest world from within the game
Home Page: https://forum.minetest.net/viewtopic.php?f=9&t=9219
mapit - A mod to show a map of the minetest world from within the game
Home Page: https://forum.minetest.net/viewtopic.php?f=9&t=9219
This mod displays a map of the entire minetest world with a location arrow and direction. It also enables you to teleport with the world, either by dividing the world into a 10x10 grid, or if you install the travelpoints mod, it will place these on the map. It can integrate with unified_Inventory, so you can access the map direct from the UI form. Finally it also provides a map node with the world map on it, which can be placed like any other node. Optional Dependancies: Travelpoints - teleport links around the minetest world https://forum.minetest.net/viewtopic.php?f=11&t=8021 Unified Inventory:https://forum.minetest.net/viewtopic.php?f=11&t=3933&start=125 I've borrowed from other peoples code, so thanks to: MAPP: https://forum.minetest.net/viewtopic.php?f=9&t=4922. VanessaE for her massive minetest colour file (I had to remove the comments as they broke the script), so maps show dramatically more features (and colours are more accurate). Maps are generated offline by minetestmapper-numpy.py https://forum.minetest.net/viewtopic.php?f=14&t=8730. The legacy minetestmapper https://forum.minetest.net/viewtopic.php?f=3&t=49 is not supported as I recoded the -numpy script to add text comments to the PNG. Not essential, but I also think MT-GitSync is great for keeping your mods uptodate https://forum.minetest.net/viewtopic.php?f=14&t=8749&hilit=gitsync USAGE: Install Dependancies:- As well as enabling the mod in minetest you will need python, numpy, and the python imaging library. Very easy in Ubuntu: in the software centre, just install python, python-numpy and python-pil or python3, python3-numpy and python3-pil. Generating map: Normally, the map will be automatically generated when you enter a new world. Alternatively there is a button on the maptool to manually reMap (but you will have to exit the world and re-enter to update the texture). It is possible to only regenerate at timed intervals (currently set up update each day, but you can set updateInterval in init.lua). However to enable this mode you'll need to install luaFileSystem. I'm not sure on Windows, but on linux it's: sudo luarocks install luafilesystem sudo apt-get install luarocks Display the map: Select the mapit:maptool in your inventory. L-button (punch) to bring up the map. So far it doesn't have a recipe, so you'll have to use creative mode, or the chat command: /give mapit:maptool On the right of the form are buttons for zoom in/out (not working), reMap (as above), and teleport and travelpoints (if you have installed that mod). With the teleport grid ground level is generally accurately identified. There used to be a bug meaning you might end up inside a node in which case if you teleport repeatedly to the same spot and as minetest loads blocks near your location, ultimately the surface will be reached (This doesn't seem to have occurred since a rewrite using voxelmanip). With travelpoints, you can either click on the number location on the map (maximum of 50), or on the buttons on the right (max of approx 20 depending on form size). TODO: It probably won't be improved much from now, but the improvements I might (or wish I could) make are:- *Zoom In and Out on the map - Would be great if it was possible to zoom in with the mousewheel, but looks like the formspec doesn't support that. *Make a big mesh billboard... Having said that, I think it is already quite a useful excellent quality map.
Hi,
on python 2.7.3, running MapWorlds.sh i get this error:
minetest@srv-nya:~/.minetest/mods/mapit$ ./MapWorlds.sh
/home/minetest/.minetest/worlds/world
world
Result image (w=592 h=672) will be written to /home/minetest/.minetest/mods/mapit/textures/world.png
Error at (-23,3,-28): 'buffer' does not have the buffer interface
Traceback (most recent call last):
File "minetestmapper-numpy.py", line 626, in generate_map_info
f = db.get(ps)
File "minetestmapper-numpy.py", line 436, in get
return BytesIO(r[0])
TypeError: 'buffer' does not have the buffer interface
Block data: Traceback (most recent call last):
File "minetestmapper-numpy.py", line 1086, in <module>
main()
File "minetestmapper-numpy.py", line 1081, in main
world.generate_map_info(str_to_uid)
File "minetestmapper-numpy.py", line 788, in generate_map_info
for c in r[0]:
NameError: global name 'r' is not defined
0.4.13-dev Linux, was installed python3, python3-numpy and python3-pil.
2015-12-03 10:12:47: ERROR[Main]: ServerError: Lua: Runtime error from mod 'mapit' in callback item_OnUse(): /home/user/minetest/bin/.
./builtin/init.lua:15: invalid value (userdata) at index 1 in table for 'concat'
2015-12-03 10:12:47: ERROR[Main]: stack traceback:
2015-12-03 10:12:47: ERROR[Main]: [C]: in function 'concat'
2015-12-03 10:12:47: ERROR[Main]: /home/user/minetest/bin/../builtin/init.lua:15: in function 'print'
2015-12-03 10:12:47: ERROR[Main]: /home/user/minetest/bin/../mods/mapit/init.lua:171: in function 'generateMapStrings'
2015-12-03 10:12:47: ERROR[Main]: /home/user/minetest/bin/../mods/mapit/init.lua:161: in function 'map_handler_maptool'
2015-12-03 10:12:47: ERROR[Main]: /home/user/minetest/bin/../mods/mapit/init.lua:156: in function </home/user/minetest/bin/../mo
ds/mapit/init.lua:155>
If i try run script manually:
root@ama:~# /home/user/minetest/mods/mapit/minetestmapper-numpy.py
Traceback (most recent call last):
File "/home/user/minetest/mods/mapit/minetestmapper-numpy.py", line 31, in
import numpy
ImportError: No module named numpy
Please remove the file textures/mapitHistory.txt from repository. If needed please add the file to the .gitignore
Please check if the usage of this file does work with security enabled that will be enabled by default at next MT-release. See https://forum.minetest.net/viewtopic.php?f=18&t=12471 for further information about the security. Maybe the minetest.get_worldpath() is a better place to store this data instead of texPath
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.