To add advanced functionality to mods adding custom keystrokes would be great. Bundling that together with pointing at nodes it could be used to give nodes more than 1 action (knocking on a door, opening/closing a door and locking/unlocking a door).
I love the idea (and have wanted it for ages), but the problem is quite simply that everything runs on the server. A packet would have to be sent for every keypress, which is just nope.
*ahem*someone hurry up and write a system for client-side scripts*ahem*
Yeah how about an Bind? like A mod allow players make binds, and it all can be saved in the player file or.. A %playername%_binds. But knocking on a door does sound interesting on Minetest. Specially for My Real Life subgame building one byte after another.
But anyway about the binding it maybe can be (well it will say in help) "/bind <key> <action/do>" and "/unbind <key>" to unbind it. that if all this is possible.
But I think we be cool see your Ideas Kenney come possible.
But be cool if we can add to an animation for knocking. and un/locking and open/close door. But how Sam Mine Swing his arm kinda looks like he is knocking.
But we do need more things to interact with the players and so on.
But all I know I think the knocking would be nice see.
I'm a Transgender no shame about it.
I prefer to be considered as a "Girl/Lady/Miss/Madam/Female" for now on.
TriBlade9 wrote:I love the idea (and have wanted it for ages), but the problem is quite simply that everything runs on the server. A packet would have to be sent for every keypress, which is just nope.
*ahem*someone hurry up and write a system for client-side scripts*ahem*
I'm not positive that a packet would have to be sent for *every* keypress. I.e. the client could be told upon connection what a key is bound to and just send a packet if that key is pressed.
Zeno wrote:I'm not positive that a packet would have to be sent for *every* keypress. I.e. the client could be told upon connection what a key is bound to and just send a packet if that key is pressed.
It has to send on every keypress, as long as scripts are server-side only (IIRC, keypresses are sent no matter what, and server decides what to do with them).
How do you handle keyboard layouts other than QWERTY?
How do you let the client change that key, especially if they already use that key for something like movement?
I would rather have more “special” keys (special2, special3, special4 would be a good start), which the client can configure.
This is already a problem, isn't it? And every other game (not to mention engines) already looked into it : picking ideas from competitors could be helpful here.
IMHO, client code should only send "actions" ("left", "right", "jump", "blahblah") and let the server decide what to do with it. The key/action mapping should be completely client side (it is already, I guess).
minetest.register_action("mymod:myaction", function(player)
-- Example callback
-- player = player who sent the action
kill_player(player)
end)
-- This binding is sent to the client
minetest.register_keybind("mymod:myaction", {
default_key = "X",
description = "Suicide"
})
On connect, the server sends all custom keybindings to the client (all registered keybinds). The client then adds those to the "Change Keys" screen.
I don't know how keys currently work though, so this may be a trivial or a huge change.
Zeno wrote:I'm not positive that a packet would have to be sent for *every* keypress. I.e. the client could be told upon connection what a key is bound to and just send a packet if that key is pressed.
It has to send on every keypress, as long as scripts are server-side only (IIRC, keypresses are sent no matter what, and server decides what to do with them).
I wasn't talking about scripts (not really anyway). I was suggesting that if a server-side script created a custom key binding then that binding be sent to the client as part of the connection negotiation. This has several roadblocks, but it does not mean that every key press would need to be sent to the server.
(IIRC, keypresses are sent no matter what, and server decides what to do with them).
Currently key presses are not sent to the server at all (the key press in the client is converted into a directive if it's relevant). Why would the server need to know about key presses in the client?