Page 1 of 1

on_help

Posted: Tue Jun 26, 2018 01:08
by Kilarin
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?

Re: on_help

Posted: Tue Jun 26, 2018 06:15
by csirolli
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?

Re: on_help

Posted: Tue Jun 26, 2018 06:30
by ChimneySwift
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...

Re: on_help

Posted: Tue Jun 26, 2018 12:46
by Linuxdirk
ChimneySwift wrote:You can add whatever you want to node definitions, [...]
As long as you prefix it with an underscore.

https://github.com/minetest/minetest/bl ... 5247-L5252

Re: on_help

Posted: Tue Jun 26, 2018 15:39
by rubenwardy
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

Re: on_help

Posted: Tue Jun 26, 2018 16:12
by Linuxdirk
rubenwardy wrote:It's just bad practice
It’s outright stupid not following the convention.

Re: on_help

Posted: Tue Jun 26, 2018 17:58
by Kilarin
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) :)

Re: on_help

Posted: Wed Jun 27, 2018 00:42
by ChimneySwift
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.

Re: on_help

Posted: Wed Jun 27, 2018 02:57
by Kilarin
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?

Re: on_help

Posted: Wed Jun 27, 2018 04:50
by ChimneySwift
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?

Re: on_help

Posted: Wed Jun 27, 2018 05:18
by Linuxdirk
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?

Re: on_help

Posted: Fri Jun 29, 2018 14:15
by Kilarin
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

Help modpack!

Posted: Wed Jul 25, 2018 01:45
by Wuzzy
Lol, you have basically requested to clone the Help modpack.

Re: on_help

Posted: Wed Jul 25, 2018 01:51
by Kilarin
oooo! That is very interesting, thank you Wuzzy!

Re: on_help

Posted: Thu Aug 30, 2018 15:12
by sorcerykid
Wuzzy designed a pretty extensive API for in-game help. I can't imagine much of a reason to replace it. If anything, I'd see about collaborating with Wuzzy on ways of extending it for different applications.

Re: on_help

Posted: Fri Aug 31, 2018 06:30
by ShadMOrdre
Kilarin wrote:"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)"
This could easily be added to the description text field of every node, craftitem, tool, or entity. An entire help system already built in, without the need for help mods or core changes. It is up to modders to use this field effectively, not just as a Name field, as some above suggested.

Having used Wuzzy's excellent doc modpack, I can honestly say this. The help provided is similar to the built in help for windows. While useful for actually learning commands, it is awfully useless in learning what commands need to be learned. Wuzzy's doc modpack provide all sorts of useful info, culled from the various built in definitions, but doesn't really tell you how to use items, or what goals to achieve, or anything else. Sorry Wuzzy, this isn't meant as insult, just an observation in general. Your're modpack will continue to be a core part of every world I play in, and will be supported by every mod I can remember to put it in. Just with the aforementioned observation, I actually provide some info to the description field of nodes i create, for the help system to proudly display!

Shad

Re: on_help

Posted: Fri Aug 31, 2018 11:14
by Wuzzy
I don't know what you mean with “commands”.

Note that for the Help modpack to be really useful, the mods in question should also add their own description of the items they add. Since many items are not self-explanatory.
Obviously, it would be insane to expect that Help includes all this info for all mods on its own. It's rather the responsibility of the mods to document themselves. The Help modpack itself only adds the basic Minetest help and whatever it can automatically harvest from the item data. What it can't do is automatically write usage descriptions. That's the job of the mods.

If the mod does not add custom descriptions, the help simply defaults to the absolute minimum that the modpack can state with certainty.

Request support for the Help modpack for the mods and games you care about. The more mods start supporting the Help modpack, the better the overall documentation of Minetest will become. That was the vision I always had with the Help modpack. The Help modpack was made especially for complex mods like Mesecons. Sadly, Mesecons devs still refuse to add any support.

The Help is still not being supported by many popular mods, and this has always be a major setback so far. I hope this will change in the future.
It's sad because I believe I tried hard to make adoption as straight-forward as possible.