[mod] Teruview - block information on click [teruview]

Terumoc
Member
 
Posts: 53
Joined: Thu Dec 28, 2017 20:00
GitHub: Terumoc
In-game: Terumoc

[mod] Teruview - block information on click [teruview]

by Terumoc » Thu Dec 28, 2017 20:25

This mod is an informational mod that gives useful info about a node (block) when it is left-clicked/punched. The current version is made for Minetest version 0.4.X, but it works fine currently in Dev Minetest 5.0 as well.

Updated to version 1.2.3
Fixed a crash related to things with no name.


Github: https://github.com/Terumoc/teruview
Direct download: download https://github.com/Terumoc/teruview/archive/master.zip then extract and rename the top folder to "teruview"

Examples are provided as the screenshot for the mod, as seen here:
Image

The information provided by the mod is described in the readme on github, but here it is duplicated:
A mod for the open-source voxel game Minetest (https://www.minetest.net/)

Provides in-game information about blocks in the world when you click on them.

Format of information box:

Line 1: Node description or ID
If the node has a description, it is displayed in white. If not, its ID is instead displayed in yellow.

Line 2: Originating Mod
The mod which owns the node definition is displayed in light blue.

Line 3: Tool Information
The node's level and defined tool types for mining it are displayed. The color of this information is dependent on your currently held tool:

Green: Current tool can successfully mine this node.
Orange: Current tool is the correct type of tool, but is not high quality enough. Either it lacks a speed for the node's hardness rating or it is of insufficient level for the node.
Red: Current tool cannot mine this node at all.

Line 4: Node Information
Any flags of interest that apply to this node are displayed, such as whether it is affected by gravity, is flammable, douses fire or lava, and so forth.

See options.lua for ways to some (minimal) ways to customize the display.


I will likely continue adding more and updating this mod, especially if it has any reported bugs, but so far it's been stable for me in worlds with varying numbers of other mods. The present version of the mod (1.1.0) can be considered very usable.

Future/desired changes and additions:
- Add an "inventory-style" view of the node to accompany the information displayed but that's proven to be far too difficult with the current API. There does not appear to be a simple way to access the inventory icon of a node at present without reconstructing it yourself.
- Have node information displayed when a node is viewed rather than when a node is clicked, which is presently very difficult to accomplish. This would also remove the need for a global step hook to handle the display disappearing after a period of time.
- Make customizing the display easier and more open-ended.
- Make the display more user-friendly and visually pleasing if more font and size options become available to HUD elements.

Hope this is helpful to some and adds to your enjoyment of this excellent game.
Last edited by Terumoc on Sat Aug 04, 2018 07:10, edited 3 times in total.
Maker of Terumetal and Teruview mods at https://github.com/Terumoc
 

Chem871
Member
 
Posts: 864
Joined: Sat Aug 19, 2017 21:49
Location: SCP-2935
GitHub: Chemguy99
In-game: Nyx Serris

Re: [mod] Teruview - block information on click [teruview]

by Chem871 » Thu Dec 28, 2017 21:08

Does it work for any mod?
What is SCP-055 again? I forgot.
 

Terumoc
Member
 
Posts: 53
Joined: Thu Dec 28, 2017 20:00
GitHub: Terumoc
In-game: Terumoc

Re: [mod] Teruview - block information on click [teruview]

by Terumoc » Thu Dec 28, 2017 21:29

If a mod uses the same node and tool mechanics as default minetest, then yes, the information provided will be accurate.

Only if a specific mod completely changes the group system which minetest uses for mining mechanics or provides entirely custom functionality on a tool would it report things incorrectly.

Also, if a mod added a new mining group that used the same default system but isn't defined or used in default minetest, it would be simple to add it to the display by adding a new line in the options.lua file.
Maker of Terumetal and Teruview mods at https://github.com/Terumoc
 

Chem871
Member
 
Posts: 864
Joined: Sat Aug 19, 2017 21:49
Location: SCP-2935
GitHub: Chemguy99
In-game: Nyx Serris

Re: [mod] Teruview - block information on click [teruview]

by Chem871 » Thu Dec 28, 2017 23:01

Such as the bendy group of nodes?
What is SCP-055 again? I forgot.
 

Terumoc
Member
 
Posts: 53
Joined: Thu Dec 28, 2017 20:00
GitHub: Terumoc
In-game: Terumoc

Re: [mod] Teruview - block information on click [teruview]

by Terumoc » Thu Dec 28, 2017 23:46

Sure, I haven't seen that group myself, but any group could be added one of two ways:

1. Added by the user to the options.lua file in the section here:
Code: Select all
teruview.tool_node_groups = {
    cracky='Pickaxe',
    crumbly='Shovel',
    choppy='Axe',
    snappy='Sword',
    oddly_breakable_by_hand='Hand'
}

adding an entry for
Code: Select all
bendy='Scissors'
(or whatever tool to label it with, just using scissors as an example) would make it recognize that group and display it

2. Or automatically added by the mod that uses "bendy" as a node group
Make teruview an optional dependency so it is loaded before the other mod, and have that mod add that entry itself like so:
Code: Select all
if teruview then teruview.tool_node_groups.bendy = 'Scissors' end


Of course, if that's actually a common node group that I just haven't seen much before, it could be added to the default options.lua
Maker of Terumetal and Teruview mods at https://github.com/Terumoc
 

Terumoc
Member
 
Posts: 53
Joined: Thu Dec 28, 2017 20:00
GitHub: Terumoc
In-game: Terumoc

Re: [mod] Teruview - block information on click [teruview]

by Terumoc » Sat Aug 04, 2018 07:08

Minor patch update to fix a rare crash I ran into when things had blank names

At some point I should really move this out of WIP since it's pretty fully functional now.
Maker of Terumetal and Teruview mods at https://github.com/Terumoc
 


Return to WIP Mods



Who is online

Users browsing this forum: No registered users and 1 guest