on_help

Post Reply
User avatar
Kilarin
Member
Posts: 894
Joined: Mon Mar 10, 2014 00:36
GitHub: Kilarin

on_help

by Kilarin » Post

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: 133
Joined: Mon Jan 15, 2018 21:46
GitHub: HeyITGuyFixIt
IRC: CSirolli
In-game: CSirolli
Location: Florida, USA
Contact:

Re: on_help

by csirolli » Post

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?

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

Re: on_help

by ChimneySwift » Post

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...
A spoon is basically a tiny bowl with a stick on it

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

Re: on_help

by Linuxdirk » Post

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

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

Re: on_help

by rubenwardy » Post

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
Renewed Tab (my browser add-on) | Donate | Mods | Minetest Modding Book

Hello profile reader

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

Re: on_help

by Linuxdirk » Post

rubenwardy wrote:It's just bad practice
It’s outright stupid not following the convention.

User avatar
Kilarin
Member
Posts: 894
Joined: Mon Mar 10, 2014 00:36
GitHub: Kilarin

Re: on_help

by Kilarin » Post

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: 320
Joined: Fri Sep 22, 2017 06:46
GitHub: ChimneySwift
IRC: ChimneySwift
In-game: ChimneySwift
Location: 127.0.0.1

Re: on_help

by ChimneySwift » Post

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.
A spoon is basically a tiny bowl with a stick on it

User avatar
Kilarin
Member
Posts: 894
Joined: Mon Mar 10, 2014 00:36
GitHub: Kilarin

Re: on_help

by Kilarin » Post

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: 320
Joined: Fri Sep 22, 2017 06:46
GitHub: ChimneySwift
IRC: ChimneySwift
In-game: ChimneySwift
Location: 127.0.0.1

Re: on_help

by ChimneySwift » Post

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?
A spoon is basically a tiny bowl with a stick on it

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

Re: on_help

by Linuxdirk » Post

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?

User avatar
Kilarin
Member
Posts: 894
Joined: Mon Mar 10, 2014 00:36
GitHub: Kilarin

Re: on_help

by Kilarin » Post

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: 4786
Joined: Mon Sep 24, 2012 15:01
GitHub: Wuzzy2
IRC: Wuzzy
In-game: Wuzzy
Contact:

Help modpack!

by Wuzzy » Post

Lol, you have basically requested to clone the Help modpack.

User avatar
Kilarin
Member
Posts: 894
Joined: Mon Mar 10, 2014 00:36
GitHub: Kilarin

Re: on_help

by Kilarin » Post

oooo! That is very interesting, thank you Wuzzy!

User avatar
sorcerykid
Member
Posts: 1841
Joined: Fri Aug 26, 2016 15:36
GitHub: sorcerykid
In-game: Nemo
Location: Illinois, USA

Re: on_help

by sorcerykid » Post

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.

ShadMOrdre
Member
Posts: 1118
Joined: Mon Dec 29, 2014 08:07
Location: USA

Re: on_help

by ShadMOrdre » Post

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

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

Re: on_help

by Wuzzy » Post

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.

Post Reply

Who is online

Users browsing this forum: No registered users and 4 guests