Page 1 of 1

Block info on hud?

PostPosted: Sun Feb 26, 2017 16:53
by mase
Hi!
Is there a mod, which displays the kind of block I am pointing to?
I don't want to leave the debug info activated all the time.

Re: Block info on hud?

PostPosted: Sun Feb 26, 2017 17:37
by burli
I only now the identify mod, but it is not very nice and it is a bit verbose.

Re: Block info on hud?

PostPosted: Mon Feb 27, 2017 01:19
by dawgdoc
Check out https://forum.minetest.net/viewtopic.php?f=11&t=15912&hilit=lookup+tool by Wuzzy. It has a Lookup Tool that goes into your inventory that is activated punching a block.

Re: Block info on hud?

PostPosted: Tue Feb 28, 2017 02:54
by Wuzzy
Sadly, it doesn't display the block name by merely pointing the block. :-(

Re: Block info on hud?

PostPosted: Tue Feb 28, 2017 11:08
by mase
I was looking for a permanent info display of the node I am pointing to.
Permanent, not craftable, and without any mouse clicking.
However this mod is also useful.

Re: Block info on hud?

PostPosted: Wed Mar 01, 2017 18:40
by sorcerykid
mase wrote:I was looking for a permanent info display of the node I am pointing to.
Permanent, not craftable, and without any mouse clicking.


I don't think what you are describing is even possible because to my knowledge server-side mods can only obtain the position of the pointed node by means of a callback (such as eating, digging, placing, etc.).

Re: Block info on hud?

PostPosted: Wed Mar 01, 2017 19:03
by mase
So the only solution seems to be keeping the debug info on.

Re: Block info on hud?

PostPosted: Wed Mar 01, 2017 19:38
by burli
sorcerykid wrote:I don't think what you are describing is even possible because to my knowledge server-side mods can only obtain the position of the pointed node by means of a callback (such as eating, digging, placing, etc.).

It is possible. Take a look at the identify mod I mentioned before. Maybe I need to upload it somewhere because I can't find it myself.

This mod does exactly what you want, but looks ugly. Look at the bottom right corner

Image

If I have time maybe I will make something that looks more like this. I want that myself

Image

Re: Block info on hud?

PostPosted: Wed Mar 01, 2017 19:57
by sorcerykid
What function returns the pointed node? I searched the API docs, and can't find it.

Re: Block info on hud?

PostPosted: Wed Mar 01, 2017 20:05
by burli
sorcerykid wrote:What function returns the pointed node? I searched the API docs, and can't find it.

Finally this code uses "get_node()", but the calculation is complex to get the coordinate of the node. The mod has over 800 lines. Maybe it is now a bit easier to do that

Re: Block info on hud?

PostPosted: Wed Mar 01, 2017 21:59
by sorcerykid
That's kind of what I figured. It seems the only way to determine the pointed node is with a lot of calculations possibly involving minetest.line_of_sight( ). Perhaps that is what the mod in question is doing.

From my research pointed node information is only passed to the server during user interaction (punching, digging, etc.) by the client via the Server::handleCommand_Interact(NetworkPacket* pkt) method in network/serverpackethandler.cpp. So it is built into the client-server protocol. There is no way to natively obtain the pointed node coordinates exclusively from the server-side without a lot of hacking.

Re: Block info on hud?

PostPosted: Thu Mar 02, 2017 05:39
by burli
I think, with client side modding it won't be a problem

Re: Block info on hud?

PostPosted: Thu Mar 02, 2017 11:05
by mase
But with the debug info activated, you get this info without a
special interaction. Maybe the api does not provide this info.