[mod] Activate minimap [minimap]

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

[mod] Activate minimap [minimap]

by AlexYst » Wed May 17, 2017 15:23

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: 1904
Joined: Sun Apr 09, 2017 05:50
Location: You wouldn't believe me
GitHub: LoneWolfHT
IRC: Lone_Wolf
In-game: Lone_Wolf or Somebody

Re: [mod] Activate minimap [minimap]

by Lone_Wolf » Thu May 18, 2017 03:45

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?
 

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

Re: [mod] Activate minimap [minimap]

by Wuzzy » Fri May 19, 2017 18:46

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.
My creations. I gladly take any bitcoins you have lying around: 17fsUywHxeMHKG41UFfu34F1rAxZcrVoqH
 

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

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

Re: [mod] Activate minimap [minimap]

by echosa » Thu May 25, 2017 04:02

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 » Thu May 25, 2017 04:09

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: 974
Joined: Mon Jul 11, 2016 21:08
GitHub: tacotexmex
In-game: texmex

Re: [mod] Activate minimap [minimap]

by texmex » Thu May 25, 2017 10:56

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 » Thu May 25, 2017 22:06

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: 974
Joined: Mon Jul 11, 2016 21:08
GitHub: tacotexmex
In-game: texmex

Re: [mod] Activate minimap [minimap]

by texmex » Fri May 26, 2017 06:56

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: 1601
Joined: Wed Sep 17, 2014 11:21
Location: Germany
In-game: Linuxdirk

Re: [mod] Activate minimap [minimap]

by Linuxdirk » Fri May 26, 2017 07:31

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 » Wed May 31, 2017 22:03

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 » Mon Jul 10, 2017 16:50

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


Is there a way to fix this? What about the ability to set mode (circle, square) and/or view (zoom?) Large image below.
+ Spoiler
 

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

Re: [mod] Activate minimap [minimap]

by kingoscargames » Sat Jul 29, 2017 09:24

It doesn't work for me:Image
Attachments
map glitch.png
(509.82 KiB) Not downloaded yet
 

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

Re: [mod] Activate minimap [minimap]

by Qbiq » Sat Jul 29, 2017 13:24

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
Location: Netherlands
GitHub: kingoscargames
In-game: kingoscargames

Re: [mod] Activate minimap [minimap]

by kingoscargames » Sat Jul 29, 2017 13:50

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: 1904
Joined: Sun Apr 09, 2017 05:50
Location: You wouldn't believe me
GitHub: LoneWolfHT
IRC: Lone_Wolf
In-game: Lone_Wolf or Somebody

Re: [mod] Activate minimap [minimap]

by Lone_Wolf » Sat Jul 29, 2017 15:41

I'm pretty sure the minimap was disabled for MineClone2
 

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

Re: [mod] Activate minimap [minimap]

by kingoscargames » Sat Jul 29, 2017 17:01

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: 892
Joined: Tue Aug 02, 2016 22:04
Location: Madrid,Spain
GitHub: ManElevation
IRC: ManElevation
In-game: ManElevation

Re: [mod] Activate minimap [minimap]

by ManElevation » Thu Aug 03, 2017 23:48

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: 317
Joined: Fri Sep 22, 2017 06:46
Location: 127.0.0.1
GitHub: ChimneySwift
IRC: ChimneySwift
In-game: ChimneySwift

Re: [mod] Activate minimap [minimap]

by ChimneySwift » Tue May 15, 2018 08:29

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
 


Return to Client-side modding



Who is online

Users browsing this forum: Bing [Bot] and 1 guest