Page 1 of 1

on_equip callback

PostPosted: Wed Nov 25, 2015 22:55
by stu
It would be really nice if there could be a callback when an item is equipped (wielded) although I realize this could cause a lot of clatter using mouse wheels etc.
I have actually done this with my visible wielded item mods by crudely polling the current wielded item, there is a slight delay but it does solve the afore mentioned problem.

I just think it would be nice if there could be a cleaner implementation of this, either provided by the engine or the built-in scripts.

Re: on_equip callback

PostPosted: Wed Nov 25, 2015 23:08
by BlockMen
stu wrote:It would be really nice if there could be a callback when an item is equipped (wielded) although I realize this could cause a lot of clatter using mouse wheels etc.
I have actually done this with my visible wielded item mods by crudely polling the current wielded item, there is a slight delay but it does solve the afore mentioned problem.

I just think it would be nice if there could be a cleaner implementation of this, either provided by the engine or the built-in scripts.


Sorry, i guess that will not happen since some core devs and other community members don't want things that can be archived with mods to be in core.
See hunger discussion for reference: https://github.com/minetest/minetest/pull/3388 . Cleaner implementations seem to become a no-go in MT ...

Re: on_equip callback

PostPosted: Wed Nov 25, 2015 23:34
by qwertymine3
BlockMen wrote:Sorry, i guess that will not happen since some core devs and other community members don't want things that can be archived with mods to be in core.
See hunger discussion for reference: https://github.com/minetest/minetest/pull/3388 . Cleaner implementations seem to become a no-go in MT ...


There are very clear differences between what stu is suggesting and your suggestion of adding hunger to the core engine.
This suggestion is not focussed entirely on the core engine, and is game-type agnostic:
Please keep your opinion of the general reaction to your suggestion to the relevant threads.

On topic -
Does the client normally update the server when the wield-item changes?
If not then it may be preferable to have a polling method - but a centralised method would be nice.

Re: on_equip callback

PostPosted: Thu Nov 26, 2015 04:50
by rubenwardy
BlockMen is just sour. Callbacks are fine. Forcing subgames to have a gameplay mechanism, and then making them disable it with a settings isn't when the gameplay mechanism can be done by a mod with no real disadvantages.