Create new keyboard bindings?

Post Reply
User avatar
Loveless
New member
Posts: 5
Joined: Thu Jul 26, 2018 19:51

Create new keyboard bindings?

by Loveless » Post

Hi everyone,

I'm thinking about making a mod that adds active skills (like spells) for a more RPG-ish gameplay. I'm currently in the is this technically possible? phase and for some aspects the answer is still unclear.

I'd like my skills to be conceptually attached to the player and not require a tool/item/etc to be cast. Ideally this would mean binding keyboard shortcuts to the skills so that they can be used quickly.

I have found little to nothing about adding keyboard actions:
- viewtopic.php?f=6&t=15411 mentions minetest.conf
- viewtopic.php?f=47&t=18861&p=301001 mentions monitoring user actions

But nothing about adding new actions, ie. invoking a mod-provided callback when a key is pressed. I would expect to use...
- a new entry in the in-game keymap configuration?
- a minetest.conf setting that would bind a new key?
- (ideally) an API call to customize the bindings?

Is there anything available to achieve this result?

I'm open to suggestions regarding other input methods. Chat commands are feasible but probably too slow for fights.

Thanks!

User avatar
Krock
Developer
Posts: 4650
Joined: Thu Oct 03, 2013 07:48
GitHub: SmallJoker
Location: Switzerland
Contact:

Re: Create new keyboard bindings?

by Krock » Post

It's also a topic for CSM to add key bindings, but that leads to key collisions and complicated combinations. It also gives an unfair advantage to Android players, since there's no simple way for them to have a similar responsible input to trigger the function.
Look, I programmed a bug for you. >> Mod Search Engine << - Mods by Krock - DuckDuckGo mod search bang: !mtmod <keyword here>

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

Re: Create new keyboard bindings?

by rubenwardy » Post

Adding this feature is on my roadmap, however I don't have as much time available to minetest as I'd like

My plan is to unify all inputs into actions. Server-side mods would be able to register actions with a default key binding, and ask to show the action on-screen or in a side menu on Android
Renewed Tab (my browser add-on) | Donate | Mods | Minetest Modding Book

Hello profile reader

User avatar
Loveless
New member
Posts: 5
Joined: Thu Jul 26, 2018 19:51

Re: Create new keyboard bindings?

by Loveless » Post

Thanks for your quick replies. I'm still new here, but rubenwardy's roadmap seems to be quite the thing, so good luck ;D

I guess I will stick with tools for now; I will try to "semantically" add skills to tools (eg. skill cut a tree goes to axes). For spells, a typical magic wand should be enough.

I know that I can register two standard actions for the wand (mapped to mouse buttons by default), is there any more available?

Post Reply

Who is online

Users browsing this forum: No registered users and 21 guests