on_help

Kilarin
Member
 
Posts: 707
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: 129
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: 318
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...
A spoon is basically a tiny bowl with a stick on it
 

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

Re: on_help

by Linuxdirk » Tue Jun 26, 2018 12:46

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: 5473
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
 

User avatar
Linuxdirk
Member
 
Posts: 1613
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: 707
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: 318
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.
A spoon is basically a tiny bowl with a stick on it
 

Kilarin
Member
 
Posts: 707
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: 318
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?
A spoon is basically a tiny bowl with a stick on it
 

User avatar
Linuxdirk
Member
 
Posts: 1613
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: 707
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: 3207
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 creations. I gladly take any bitcoins you have lying around: 17fsUywHxeMHKG41UFfu34F1rAxZcrVoqH
 

Kilarin
Member
 
Posts: 707
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!
 

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

Re: on_help

by sorcerykid » Thu Aug 30, 2018 15:12

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: 119
Joined: Mon Dec 29, 2014 08:07
Location: USA
In-game: shadmordre

Re: on_help

by ShadMOrdre » Fri Aug 31, 2018 06:30

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
My other virtual world is an Opensimulator.
 

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

Re: on_help

by Wuzzy » Fri Aug 31, 2018 11:14

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.
My creations. I gladly take any bitcoins you have lying around: 17fsUywHxeMHKG41UFfu34F1rAxZcrVoqH
 


Return to Feature Discussion



Who is online

Users browsing this forum: No registered users and 1 guest