[mod] Activate minimap [minimap]

Post Reply
User avatar
AlexYst
Member
Posts: 109
Joined: Fri Mar 20, 2015 01:24
GitHub: y-st
IRC: AlexYst
In-game: AlexYst
Contact:

[mod] Activate minimap [minimap]

by AlexYst » Post

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!

User avatar
Lone_Wolf
Member
Posts: 2576
Joined: Sun Apr 09, 2017 05:50
GitHub: LoneWolfHT
IRC: LandarVargan
In-game: LandarVargan

Re: [mod] Activate minimap [minimap]

by Lone_Wolf » Post

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?
My ContentDB -|- Working on CaptureTheFlag -|- Minetest Forums Dark Theme!! (You need it)

User avatar
Wuzzy
Member
Posts: 4786
Joined: Mon Sep 24, 2012 15:01
GitHub: Wuzzy2
IRC: Wuzzy
In-game: Wuzzy
Contact:

Re: [mod] Activate minimap [minimap]

by Wuzzy » Post

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.

User avatar
texmex
Member
Posts: 1753
Joined: Mon Jul 11, 2016 21:08
GitHub: tacotexmex
In-game: tacotexmex

Re: [mod] Activate minimap [minimap]

by texmex » Post


echosa
Member
Posts: 107
Joined: Tue Aug 30, 2016 04:01

Re: [mod] Activate minimap [minimap]

by echosa » Post

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.

echosa
Member
Posts: 107
Joined: Tue Aug 30, 2016 04:01

Re: [mod] Activate minimap [minimap]

by echosa » Post

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.

User avatar
texmex
Member
Posts: 1753
Joined: Mon Jul 11, 2016 21:08
GitHub: tacotexmex
In-game: tacotexmex

Re: [mod] Activate minimap [minimap]

by texmex » Post

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.

echosa
Member
Posts: 107
Joined: Tue Aug 30, 2016 04:01

Re: [mod] Activate minimap [minimap]

by echosa » Post

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.

User avatar
texmex
Member
Posts: 1753
Joined: Mon Jul 11, 2016 21:08
GitHub: tacotexmex
In-game: tacotexmex

Re: [mod] Activate minimap [minimap]

by texmex » Post

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.

User avatar
Linuxdirk
Member
Posts: 3217
Joined: Wed Sep 17, 2014 11:21
In-game: Linuxdirk
Location: Germany
Contact:

Re: [mod] Activate minimap [minimap]

by Linuxdirk » Post

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!

echosa
Member
Posts: 107
Joined: Tue Aug 30, 2016 04:01

Re: [mod] Activate minimap [minimap]

by echosa » Post

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.

Qbiq
Member
Posts: 31
Joined: Sun Jul 09, 2017 17:37
In-game: Qbiq

Re: [mod] Activate minimap [minimap]

by Qbiq » Post

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

User avatar
kingoscargames
Member
Posts: 216
Joined: Fri Jul 28, 2017 12:06
GitHub: kingoscargames
In-game: kingoscargames
Location: Netherlands

Re: [mod] Activate minimap [minimap]

by kingoscargames » Post

It doesn't work for me:Image
Attachments
map glitch.png
map glitch.png (509.82 KiB) Viewed 4228 times

Qbiq
Member
Posts: 31
Joined: Sun Jul 09, 2017 17:37
In-game: Qbiq

Re: [mod] Activate minimap [minimap]

by Qbiq » Post

kingoscargames wrote:(Snip)
Pressing F9 doesn't fix it? All I have to do is press F9 once and it's fine.

User avatar
kingoscargames
Member
Posts: 216
Joined: Fri Jul 28, 2017 12:06
GitHub: kingoscargames
In-game: kingoscargames
Location: Netherlands

Re: [mod] Activate minimap [minimap]

by kingoscargames » Post

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

User avatar
Lone_Wolf
Member
Posts: 2576
Joined: Sun Apr 09, 2017 05:50
GitHub: LoneWolfHT
IRC: LandarVargan
In-game: LandarVargan

Re: [mod] Activate minimap [minimap]

by Lone_Wolf » Post

I'm pretty sure the minimap was disabled for MineClone2
My ContentDB -|- Working on CaptureTheFlag -|- Minetest Forums Dark Theme!! (You need it)

User avatar
kingoscargames
Member
Posts: 216
Joined: Fri Jul 28, 2017 12:06
GitHub: kingoscargames
In-game: kingoscargames
Location: Netherlands

Re: [mod] Activate minimap [minimap]

by kingoscargames » Post

Lone_Wolf wrote:I'm pretty sure the minimap was disabled for MineClone2
You need a map in your hotbar.

User avatar
ManElevation
Member
Posts: 896
Joined: Tue Aug 02, 2016 22:04
GitHub: ManElevation
IRC: ManElevation
In-game: ManElevation
Location: Madrid,Spain

Re: [mod] Activate minimap [minimap]

by ManElevation » Post

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
My Public Mods! Discord: Rottweiler Games#3368

User avatar
ChimneySwift
Member
Posts: 320
Joined: Fri Sep 22, 2017 06:46
GitHub: ChimneySwift
IRC: ChimneySwift
In-game: ChimneySwift
Location: 127.0.0.1

Re: [mod] Activate minimap [minimap]

by ChimneySwift » Post

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".
A spoon is basically a tiny bowl with a stick on it

Post Reply

Who is online

Users browsing this forum: No registered users and 0 guests