[Mod] Node Information on_punch [punchinfo]

User avatar
octacian
Member
 
Posts: 593
Joined: Mon Dec 21, 2015 22:18
Location: BC, Canada
GitHub: octacian
IRC: octacian
In-game: octacian

[Mod] Node Information on_punch [punchinfo]

by octacian » Sun Jan 15, 2017 18:52

Image

Node Information on_punch [punchinfo]


This is another fairly simple utility mod, but it can serve a very useful purpose. PunchInfo was originally inspired by azekill_DIABLO's NodeExploror mod. However, NodeExplorer was lacking in several areas, and since it wasn't on GitHub, I decided to start over from scratch.

The concept of PunchInfo is very simple, whenever a player left-clicks (i.e. punches) a node, information about that node is shown. This information includes the description, itemstring, top texture, light emission level, drawtype, and groups. The HUD is removed after 2 seconds (configurable in minetest.conf with punchnode.hud_show_time, integer). This can also be configured per-player via the chatcommand.

If you find the HUD to be too big, it can be configured to one of three sizes in minetest.conf with punchnode.hud_size. The HUD size can be set to one of three integers, 1, 2, or 3 (2 is default).

Chatcommand
The HUD can be managed and customized per-player with the /punchinfo command. This single command accepts several parameters, as seen below.

clear: Clears custom configuration for the player (show time, size, etc...)
get <key>: Gets HUD information (e.g. size)
enable: Enables the PunchInfo HUD
disable: Disables the PunchInfo HUD
time <integer>: Sets the time before the HUD is hidden
size <integer>: Sets the HUD size to 1, 2, or 3
Last edited by octacian on Tue Jan 17, 2017 05:47, edited 5 times in total.
MicroExpansion, Working Computers, All Projects - Check out my YouTube channel! (octacian)
 

User avatar
DS-minetest
Member
 
Posts: 1026
Joined: Thu Jun 19, 2014 19:49
Location: in front of my pc (which is at home)
GitHub: DS-Minetest
In-game: DS

Re: [Mod] Node Information on_punch [punchinfo]

by DS-minetest » Sun Jan 15, 2017 18:56

Is the information sent to all players on server, I hope and assume not. Can it be disabled by player in game for him/herself?
Do not call me -minetest.
Call me DS or DS-minetest.
I am German, so you don't have to pm me English if you are also German.
The background is a lie.
 

User avatar
octacian
Member
 
Posts: 593
Joined: Mon Dec 21, 2015 22:18
Location: BC, Canada
GitHub: octacian
IRC: octacian
In-game: octacian

Re: [Mod] Node Information on_punch [punchinfo]

by octacian » Sun Jan 15, 2017 18:58

DS-minetest wrote:Is the information sent to all players on server, I hope and assume not. Can it be disabled by player in game for him/herself?


No. It is only sent to the player who punched the node. I'm working on a screenshot, which will be up soon. I hadn't thought about disabling it per-player, will do.
MicroExpansion, Working Computers, All Projects - Check out my YouTube channel! (octacian)
 

User avatar
octacian
Member
 
Posts: 593
Joined: Mon Dec 21, 2015 22:18
Location: BC, Canada
GitHub: octacian
IRC: octacian
In-game: octacian

Re: [Mod] Node Information on_punch [punchinfo]

by octacian » Sun Jan 15, 2017 20:01

Added command to enable or disable PunchInfo HUD per-player. See original post.

Screenshot posted.
MicroExpansion, Working Computers, All Projects - Check out my YouTube channel! (octacian)
 

scottvee
Member
 
Posts: 18
Joined: Thu Jan 12, 2017 07:59
In-game: scottvee

Re: [Mod] Node Information on_punch [punchinfo]

by scottvee » Mon Jan 16, 2017 09:27

Well that would be easier than reading everyone's source code to see specific properties of things. Will try it out. ;-)
 

scottvee
Member
 
Posts: 18
Joined: Thu Jan 12, 2017 07:59
In-game: scottvee

Re: [Mod] Node Information on_punch [punchinfo]

by scottvee » Mon Jan 16, 2017 09:42

Hi Octacian. I got an odd error when punching one of my own blocks. You can see from the F5 debug readout that the fields are filled in, but after a punch I get an error that "tiles" is nil.

Image

Here is definition of my node:

minetest.register_node("fall_stones:fall_cobble", {
description = "Fall Cobble",
light_source = fall_stones_debug_light,
tiles = {"default_cobble.png"},
groups = {cracky=2, falling_node = 1, stone=2},
sounds = default.node_sound_sand_defaults(),
drop = 'default:gravel'
})

It does have a tiles property.

Seemed a bit odd, thought I should send it along.
 

User avatar
mahmutelmas06
Member
 
Posts: 367
Joined: Mon Mar 02, 2015 13:10
GitHub: mahmutelmas06
IRC: mahmutelmas06
In-game: masum

Re: [Mod] Node Information on_punch [punchinfo]

by mahmutelmas06 » Mon Jan 16, 2017 13:00

thank you for this mod
Hud is too big. You need to make it smaller.
My Mods:

Beverage
 

User avatar
octacian
Member
 
Posts: 593
Joined: Mon Dec 21, 2015 22:18
Location: BC, Canada
GitHub: octacian
IRC: octacian
In-game: octacian

Re: [Mod] Node Information on_punch [punchinfo]

by octacian » Mon Jan 16, 2017 16:09

scottvee wrote:Hi Octacian. I got an odd error when punching one of my own blocks. You can see from the F5 debug readout that the fields are filled in, but after a punch I get an error that "tiles" is nil.


Thanks for sending the code for your node. Just tested with the code, and didn't have any issues. Maybe try updating the mod as I may have pushed amendments to a commit fixing that issue, can't remember. Anyway, download the mod again and try it, if there's still an issue. I'll see if I can rewrite the code for getting the texture.
MicroExpansion, Working Computers, All Projects - Check out my YouTube channel! (octacian)
 

User avatar
octacian
Member
 
Posts: 593
Joined: Mon Dec 21, 2015 22:18
Location: BC, Canada
GitHub: octacian
IRC: octacian
In-game: octacian

Re: [Mod] Node Information on_punch [punchinfo]

by octacian » Tue Jan 17, 2017 01:09

mahmutelmas06 wrote:thank you for this mod
Hud is too big. You need to make it smaller.


I'm working on adding an option allowing you to choose between 3 different sizes. The medium size will become default. After that, I will allow players to configure the show time and HUD size for themselves, rather than applying the same to all players.
MicroExpansion, Working Computers, All Projects - Check out my YouTube channel! (octacian)
 

User avatar
octacian
Member
 
Posts: 593
Joined: Mon Dec 21, 2015 22:18
Location: BC, Canada
GitHub: octacian
IRC: octacian
In-game: octacian

Re: [Mod] Node Information on_punch [punchinfo]

by octacian » Tue Jan 17, 2017 05:49

Added 3 configurable HUD sizes and commands allowing each player to customize their own HUD. Also fixed the bug mentioned near the end of the video (linked in OP) where the HUD would be hidden immediately after punching blocks quickly. See original post and video for more info.
MicroExpansion, Working Computers, All Projects - Check out my YouTube channel! (octacian)
 


Return to WIP Mods



Who is online

Users browsing this forum: davidthecreator, texmex and 1 guest