on_help

Kilarin
Member
 
Posts: 681
Joined: Mon Mar 10, 2014 00:36

on_help

by Kilarin » Tue Jun 26, 2018 01:08

I would like to propose an idea that I discussed here once before a LONG time ago.

Minetest needs a built in help BY NODE function.

Every node and item should be able to have an on_help="help string" that will be displayed like a tool tip whenever the user points the cursor at that item and hits "?"

It should work whether the user is pointing at a node in the world, OR if their cursor is hovering over an item in their inventory and they hit question mark.

For example, the bridge tool might have:

minetest.register_tool("bridgetool:bridge_tool", {
description = "Bridge Tool",
inventory_image = "bridgetool_wield.png",
wield_image = "bridgetool_wield.png^[transformR90",
on_place = bridgetool_place,
on_use = bridgetool_switchmode
on_help="Bridge Tool: right click places the item from stack one place to the right in inventory\nleft click=change mode (forward,down,up)\n<sneak>left click=change width (1,2,3)"
})

And the cart could have:
on_help="left click=push cart\nright click=mount\n<sneak>right click=dismount\n<jump>=lock view"

The on_help for the furnace could explain it's basic use. The on help for the screwdriver could explain how it works. The on_help for an ore might even explain what it is useful for (if the designer so chose)

Since this would just be a simple string in the lua of the node definition, it would be very simple for mod and game designers to specify exactly as much (or as little) help as they wanted the users to have.

This seems to me like a feature that would be relatively easy to implement, and could have a major impact on improving the ease of use of the game.

What do you think?
 

User avatar
csirolli
Member
 
Posts: 128
Joined: Mon Jan 15, 2018 21:46
Location: Florida, USA
GitHub: ChristianSirolli
IRC: CSirolli
In-game: CSirolli

Re: on_help

by csirolli » Tue Jun 26, 2018 06:15

The actual implementation of it may be a bit difficult. Have fun getting other mods to support this if/when this is implemented. MTE devs, does the engine support this idea?
Jesus is the only Way to heaven, the only saving Truth, and the only Life that is worth living.
 

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

Re: on_help

by ChimneySwift » Tue Jun 26, 2018 06:30

You can add whatever you want to node definitions, so this would be doable in a mod, however without official engine changes I seriously doubt it would take off...
"You have to be a pretty sad person to quote yourself" ~ ChimneySwift
 

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

User avatar
rubenwardy
Moderator
 
Posts: 5421
Joined: Tue Jun 12, 2012 18:11
Location: United Kingdom
GitHub: rubenwardy
IRC: rubenwardy
In-game: rubenwardy

Re: on_help

by rubenwardy » Tue Jun 26, 2018 15:39

That's only to stop collisions with properties added in future versions. Tables are stored in Lua, so there's nothing stopping you from adding properties named anything that isn't already used. It's just bad practice
Core Developer | Donate | My Twitter | Mods | Mods 4 Android | Node Box Editor | Minetest Modding Book

Hello profile reader

LgiOxMFYXOqtqVqMPhbw1Bn3oNRvEC7j
 

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

Re: on_help

by Linuxdirk » Tue Jun 26, 2018 16:12

rubenwardy wrote:It's just bad practice

It’s outright stupid not following the convention.
 

Kilarin
Member
 
Posts: 681
Joined: Mon Mar 10, 2014 00:36

Re: on_help

by Kilarin » Tue Jun 26, 2018 17:58

Yes, obviously an engine change would be required.
Would it be a big change? I would assume getting pointed at if you press the ? and retrieving a property would NOT be a major change (like colored lighting) :)
 

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

Re: on_help

by ChimneySwift » Wed Jun 27, 2018 00:42

I wouldn't say it's outright stupid... There are several excellent/popular mods that do it, eg:
https://github.com/minetest-mods/pipewo ... es.lua#L16

I can't say I'm not surprised though, adding an underscore would certainly be smarter.

It probably wouldn't be a big change, since it would probably be implemented in builtin and accessed with a tool or something in minetest_game (or implemented entirely in minetest_game/default) or via a command. I see no reason why a C++ change would be required unless I'm missing something.

Honestly, official support of on_help in the api would probably be all that was required and from then on people could make mods to display the help data.
"You have to be a pretty sad person to quote yourself" ~ ChimneySwift
 

Kilarin
Member
 
Posts: 681
Joined: Mon Mar 10, 2014 00:36

Re: on_help

by Kilarin » Wed Jun 27, 2018 02:57

ChimneySwift wrote:Honestly, official support of on_help in the api would probably be all that was required and from then on people could make mods to display the help data.

With a tool, sure. But how could a mod detect when the question mark key is being pressed?
 

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

Re: on_help

by ChimneySwift » Wed Jun 27, 2018 04:50

Kilarin wrote:With a tool, sure. But how could a mod detect when the question mark key is being pressed?


True. If you wanted to map help to a key you would need C++ changes, my bad. In that case it would be done client-side?
"You have to be a pretty sad person to quote yourself" ~ ChimneySwift
 

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

Re: on_help

by Linuxdirk » Wed Jun 27, 2018 05:18

ChimneySwift wrote:There are several excellent/popular mods that do it

This is no excuse. it is still stupid and should not be done.

ChimneySwift wrote:Honestly, official support of on_help in the api would probably be all that was required and from then on people could make mods to display the help data.

But what is on_help? Just a string? Can it be a function, too (like the other on_* attributes)?

Wouldn't it be better to add name as attribute, and use it like description is currently used and use description for an actual description and/or usage information?
 

Kilarin
Member
 
Posts: 681
Joined: Mon Mar 10, 2014 00:36

Re: on_help

by Kilarin » Fri Jun 29, 2018 14:15

Linuxdirk wrote:But what is on_help? Just a string? Can it be a function, too (like the other on_* attributes)?

I was thinking just a string, but I suppose a function that returned a string would be fine as well
 

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

Help modpack!

by Wuzzy » Wed Jul 25, 2018 01:45

Lol, you have basically requested to clone the Help modpack.
My projects: MineClone 2. Hades Revisited. Help modpack. A ton of other mods, see here.
 

Kilarin
Member
 
Posts: 681
Joined: Mon Mar 10, 2014 00:36

Re: on_help

by Kilarin » Wed Jul 25, 2018 01:51

oooo! That is very interesting, thank you Wuzzy!
 


Return to Feature Discussion



Who is online

Users browsing this forum: No registered users and 3 guests