on_equip callback

User avatar
stu
Member
 
Posts: 737
Joined: Sat Feb 02, 2013 02:51
GitHub: stujones11

on_equip callback

by stu » Wed Nov 25, 2015 22:55

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.
 

User avatar
BlockMen
Member
 
Posts: 768
Joined: Fri Mar 01, 2013 17:24
GitHub: BlockMen

Re: on_equip callback

by BlockMen » Wed Nov 25, 2015 23:08

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 ...
 

User avatar
qwertymine3
Member
 
Posts: 194
Joined: Wed Jun 03, 2015 14:33
GitHub: Qwertymine
In-game: qwertymine3

Re: on_equip callback

by qwertymine3 » Wed Nov 25, 2015 23:34

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.
Avatar by :devnko-ennekappao:
 

User avatar
rubenwardy
Member
 
Posts: 4500
Joined: Tue Jun 12, 2012 18:11
GitHub: rubenwardy
IRC: rubenwardy
In-game: rubenwardy

Re: on_equip callback

by rubenwardy » Thu Nov 26, 2015 04:50

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.
 


Return to Minetest Features

Who is online

Users browsing this forum: No registered users and 13 guests

cron