featuring:
- whisper
- give items
- (admin) kick
- (admin) peek/open inventory
I wanted to ask if anyone would appreciate this...PolySaken wrote:This would be quite easy to implement with a server side mod.
It would be a good idea for servers with no exchange/shop mods and for administrating players directly,theFox wrote:I wanted to ask if anyone would appreciate this...
It would make the game a lot easier, specially the part of giving items.theFox wrote:I wanted to ask if anyone would appreciate this...
Maybe the talk option could be used to add realism? a server could require players to be next to each other to talk.MineYoshi wrote:It would make the game a lot easier, specially the part of giving items.theFox wrote:I wanted to ask if anyone would appreciate this...
I find this quite annoying. Maybe an option to chat privately being close could be good, let's be honest, but being alone on a mine and not being able to ask someone for help truly isn't so funny at all.PolySaken wrote:Maybe the talk option could be used to add realism? a server could require players to be next to each other to talk.MineYoshi wrote:It would make the game a lot easier, specially the part of giving items.theFox wrote:I wanted to ask if anyone would appreciate this...
Sadly, it's not that easy. I attempted this about a year ago, but never got it to work using the existing API since right-click events are ignored for player objects. I ended up having to add an on_player_rightclick( ) callback to the engine.PolySaken wrote:This would be quite easy to implement with a server side mod. Redefine hand on_secondary_use to check if pointed_thing is a player. Then open a formspec with said options.
on_secondary_use overrides other rightlick functions though, does it not?sorcerykid wrote:Sadly, it's not that easy. I attempted this about a year ago, but never got it to work using the existing API since right-click events are ignored for player objects. I ended up having to add an on_player_rightclick( ) callback to the engine.PolySaken wrote:This would be quite easy to implement with a server side mod. Redefine hand on_secondary_use to check if pointed_thing is a player. Then open a formspec with said options.
From the source files below, you can see that server packet handler intercepts the event and calls the rightClick( ) method of the player object, which is no-op by default.
https://github.com/minetest/minetest/bl ... r.cpp#L987
https://github.com/minetest/minetest/bl ... ect.h#L141
Maybe display a speech-balloon for private / line-of-sight talking ?PolySaken wrote:talk option .. server could require players to be next to each other to talk.
I like the idea, and I could imagine exciting possibilities of player-player interactions by this.theFox wrote:How about a menu that pops up when you rightclick a player?
featuring:
- whisper
- give items
- (admin) kick
- (admin) peek/open inventory
Do you happen to have a pull request opened for the engine addition? I don't think it's justified to only be able to set "on_rightclick" handlers for non-player objects.sorcerykid wrote:Sadly, it's not that easy. I attempted this about a year ago, but never got it to work using the existing API since right-click events are ignored for player objects. I ended up having to add an on_player_rightclick( ) callback to the engine.PolySaken wrote:This would be quite easy to implement with a server side mod. Redefine hand on_secondary_use to check if pointed_thing is a player. Then open a formspec with said options.
From the source files below, you can see that server packet handler intercepts the event and calls the rightClick( ) method of the player object, which is no-op by default.
https://github.com/minetest/minetest/bl ... r.cpp#L987
https://github.com/minetest/minetest/bl ... ect.h#L141
Great, thanks!sorcerykid wrote:Here are the changes I made to the engine, with git patches for Minetest 0.4.15 and up: viewtopic.php?f=7&t=20722
Usage is similar to that of Lua entities, except it's a global callback.
I hope you find it useful on your server!
- minetest.register_on_rightclickplayer(func(player, clicker))
Regarding giving items, you might be interested in a mod I started on: https://github.com/zeuner/structured_communication. It's about giving items to another player in exchange for other items.theFox wrote:How about a menu that pops up when you rightclick a player?
featuring:
- whisper
- give items
- (admin) kick
- (admin) peek/open inventory
Code: Select all
p2p.register_on_right_clickplayer(function(clicker, clicked)
minetest.chat_send_player(clicker:get_player_name(), "Right Clicked "..tostring(clicked:get_player_name()))
end)
I have a PR in review which incorporates the patch I shared above. Hopefully it will be merged into 5.4.zeuner wrote:I'm mostly doing minetest development for allowing people to run the modifications on their servers. So I would still think it would be a valuable contribution to let the patch find its way into the officially distributed server source.
I hope that this is the case, for me it is fundamental, for the interaction with NPCs and other players without being by commands. For example, right now I have in mind to share objects between inventories.sorcerykid wrote: ↑Fri Aug 28, 2020 20:22I have a PR in review which incorporates the patch I shared above. Hopefully it will be merged into 5.4.zeuner wrote:I'm mostly doing minetest development for allowing people to run the modifications on their servers. So I would still think it would be a valuable contribution to let the patch find its way into the officially distributed server source.
https://github.com/minetest/minetest/pull/9569
I will use It for my pickpocketing mod.emperor_genshin wrote: ↑Fri Aug 28, 2020 19:05Made my own solution to this for the time being without the need to fiddle with core: https://notabug.org/Genshin/p2p
Example using this mod:Wiki: https://notabug.org/Genshin/p2p/wiki/How+to+use+the+apiCode: Select all
p2p.register_on_right_clickplayer(function(clicker, clicked) minetest.chat_send_player(clicker:get_player_name(), "Right Clicked "..tostring(clicked:get_player_name())) end)
Example Video: https://www.youtube.com/watch?v=PtzILeR0eWs
Users browsing this forum: No registered users and 1 guest