Page 1 of 1

[mod] Activate minimap [minimap]

Posted: Wed May 17, 2017 15:23
by AlexYst
When you log into a server, there's a number of keys you have to hit every time. F3 to disable fog, F5 to enable debug info so you can see your coordinates, and F9 to turn on the mimimap. The first of these two can be automated with configuration settings ("enable_fog = false" and "show_debug = true", respectively), but there's no option to turn the mimimap on automatically! This mod just turns the minimap on so you don't have to remember to do it yourself.

Create a directory named "minimap" in your "clientmods" directory. Add an "init.lua" file to it with only this single line:

Code: Select all

minetest.ui.minimap:show()
That's all it takes!

Re: [mod] Activate minimap [minimap]

Posted: Thu May 18, 2017 03:45
by Lone_Wolf
y.st. wrote:When you log into a server, there's a number of keys you have to hit every time. F3 to disable fog, F5 to enable debug info so you can see your coordinates, and F9 to turn on the mimimap. The first of these two can be automated with configuration settings ("enable_fog = false" and "show_debug = true", respectively), but there's no option to turn the mimimap on automatically! This mod just turns the minimap on so you don't have to remember to do it yourself.

Create a directory named "minimap" in your "clientmods" directory. Add an "init.lua" file to it with only this single line:

Code: Select all

minetest.ui.minimap:show()
That's all it takes!
How to make it so I can see myself on the minimap as a red arrow?

Re: [mod] Activate minimap [minimap]

Posted: Fri May 19, 2017 18:46
by Wuzzy
IMO it would be better if there would be just a simple on/off setting in the engine.
I don't like the idea of using mods to add missing engine features.

Re: [mod] Activate minimap [minimap]

Posted: Wed May 24, 2017 12:37
by texmex

Re: [mod] Activate minimap [minimap]

Posted: Thu May 25, 2017 04:02
by echosa
I agree with Wuzzy, but until this option does exist in the engine, I'm all for this mod. This is something I've wanted for a while and have asked about on these forums before.

Re: [mod] Activate minimap [minimap]

Posted: Thu May 25, 2017 04:09
by echosa
I'm trying to add this to my subgame. I added a "minimap" directory in the "mods", added "init.lua" to "minimap", then added the one line of lua code to init.lua. However, now when I load a world in my game, I get:

Code: Select all

2017-05-24 23:05:50: ERROR[Main]: ModError: Failed to load and run script from /Users/echosa/Library/Application Support/minetest/games/boldly_go/mods/minimap/init.lua:
2017-05-24 23:05:50: ERROR[Main]: ...n Support/minetest/games/boldly_go/mods/minimap/init.lua:1: attempt to index field 'ui' (a nil value)
2017-05-24 23:05:50: ERROR[Main]: stack traceback:
2017-05-24 23:05:50: ERROR[Main]: 	...n Support/minetest/games/boldly_go/mods/minimap/init.lua:1: in main chunk
2017-05-24 23:05:50: ERROR[Main]: Check debug.txt for details.

Re: [mod] Activate minimap [minimap]

Posted: Thu May 25, 2017 10:56
by texmex
I believe this is a Client-Side Mod (CSM), hence it's useless for all but the individual player using the client. The player need to install CSMs manually themselves currently. IIRC those mods should sit in /clientmods.

Re: [mod] Activate minimap [minimap]

Posted: Thu May 25, 2017 22:06
by echosa
Hm. I tried creating a "clientmods" directory next to the "mods" directory in my game and putting minimap/init.lua there. It doesn't crash the game, but it doesn't work. I thought maybe the issue was that I'd put it inside my custom game, so I moved the entire clientmods directory to the root level next to "client", "debug.txt", "games", and "worlds". It still doesn't work. When I open a game, the minimap isn't automatically opened as expected.

Re: [mod] Activate minimap [minimap]

Posted: Fri May 26, 2017 06:56
by texmex
echosa wrote:Hm. I tried creating a "clientmods" directory next to the "mods" directory in my game and putting minimap/init.lua there. It doesn't crash the game, but it doesn't work. I thought maybe the issue was that I'd put it inside my custom game, so I moved the entire clientmods directory to the root level next to "client", "debug.txt", "games", and "worlds". It still doesn't work. When I open a game, the minimap isn't automatically opened as expected.
Hmm, note that you also need a very fresh dev build of Minetest for this to work.

Re: [mod] Activate minimap [minimap]

Posted: Fri May 26, 2017 07:31
by Linuxdirk
Wuzzy wrote:IMO it would be better if there would be just a simple on/off setting in the engine.
I don't like the idea of using mods to add missing engine features.
This. Exactly this!

Re: [mod] Activate minimap [minimap]

Posted: Wed May 31, 2017 22:03
by echosa
texmex wrote:Hmm, note that you also need a very fresh dev build of Minetest for this to work.
How fresh is "very fresh"? I had the latest dev build at the time of posting. Seems like that should have been new enough. I'll try building again today and see if I can get it working.

Re: [mod] Activate minimap [minimap]

Posted: Mon Jul 10, 2017 16:50
by Qbiq
What I did (I copied structure of other CSM):

Code: Select all

 - Created ~/.minetest/clientmods/minimap
 - Created init.lua
   - minetest.ui.minimap:show()
 - Created description.txt
   - Automatically shows minimap.
 - Created mod.confg
   - name = minimap
What happens:
It automatically shows the map, but it is a border with a transparent center. I have to press F9 to make it show up.
[EDIT] Here's the error it throws: Irrlicht: Invalid size of image for OpenGL Texture
Screenshot below.
Spoiler
Image
Is there a way to fix this? What about the ability to set mode (circle, square) and/or view (zoom?) Large image below.
Spoiler
Image

Re: [mod] Activate minimap [minimap]

Posted: Sat Jul 29, 2017 09:24
by kingoscargames
It doesn't work for me:Image

Re: [mod] Activate minimap [minimap]

Posted: Sat Jul 29, 2017 13:24
by Qbiq
kingoscargames wrote:(Snip)
Pressing F9 doesn't fix it? All I have to do is press F9 once and it's fine.

Re: [mod] Activate minimap [minimap]

Posted: Sat Jul 29, 2017 13:50
by kingoscargames
Qbiq wrote:
kingoscargames wrote:(Snip)
Pressing F9 doesn't fix it? All I have to do is press F9 once and it's fine.
It does

Re: [mod] Activate minimap [minimap]

Posted: Sat Jul 29, 2017 15:41
by Lone_Wolf
I'm pretty sure the minimap was disabled for MineClone2

Re: [mod] Activate minimap [minimap]

Posted: Sat Jul 29, 2017 17:01
by kingoscargames
Lone_Wolf wrote:I'm pretty sure the minimap was disabled for MineClone2
You need a map in your hotbar.

Re: [mod] Activate minimap [minimap]

Posted: Thu Aug 03, 2017 23:48
by ManElevation
y.st. wrote:When you log into a server, there's a number of keys you have to hit every time. F3 to disable fog, F5 to enable debug info so you can see your coordinates, and F9 to turn on the mimimap. The first of these two can be automated with configuration settings ("enable_fog = false" and "show_debug = true", respectively), but there's no option to turn the mimimap on automatically! This mod just turns the minimap on so you don't have to remember to do it yourself.

Create a directory named "minimap" in your "clientmods" directory. Add an "init.lua" file to it with only this single line:

Code: Select all

minetest.ui.minimap:show()
That's all it takes!
Wth only that! Great

Re: [mod] Activate minimap [minimap]

Posted: Tue May 15, 2018 08:29
by ChimneySwift
For those who try this and the minimap fails to load properly (eg some kind of square but the map is broken), I think this is due to the map blocks not being loaded at the time the minimap is loaded.

The solution is to add a small delay before loading the minimap after connecting:

Code: Select all

minetest.register_on_connect(function()
    minetest.after(0.1, function()
            minetest.ui.minimap:show()
    end)
end)
If this still doesn't work, try increasing "0.1".