Page 1 of 1

[Mod] On eat [on_eat]

PostPosted: Thu May 16, 2019 09:28
by bosapara
On Eat
___________________________________________________________________________________________________

Image Download | Github


"Minecraft like" particles idea for eating

Image

How it works? Using 1 mask texture we get this:

Image

Re: [Mod] On eat [on_eat]

PostPosted: Thu May 16, 2019 16:42
by texmex
Excellent contribution. I’ve seen similar in MCL2 but not as standalone. You should submit this to either MTG or even the engine’s builtin Lua.

Re: [Mod] On eat [on_eat]

PostPosted: Fri May 17, 2019 09:39
by bosapara
texmex wrote:Excellent contribution. I’ve seen similar in MCL2 but not as standalone. You should submit this to either MTG or even the engine’s builtin Lua.


As i know mcl2 has just default textures idea for eat particles or you mean different particles?

local texture = minetest.registered_items[itemname].inventory_image

Image

Re: [Mod] On eat [on_eat]

PostPosted: Fri May 17, 2019 09:47
by runs
It does not work for me. Maybe it conflicts with Default or another mod, I do not know.

Re: [Mod] On eat [on_eat]

PostPosted: Fri May 17, 2019 09:56
by bosapara
runs wrote:It does not work for me. Maybe it conflicts with Default or another mod, I do not know.


Yes of course, if you use hudbars or stamina mods - it will not work

Try to turn off another mods or just add particles code to that mods

Re: [Mod] On eat [on_eat]

PostPosted: Fri May 17, 2019 21:52
by runs
bosapara wrote:
runs wrote:It does not work for me. Maybe it conflicts with Default or another mod, I do not know.


Yes of course, if you use hudbars or stamina mods - it will not work

Try to turn off another mods or just add particles code to that mods


Oh, any workaround to get all of them?
:-(

Re: [Mod] On eat [on_eat]

PostPosted: Sat May 18, 2019 06:48
by bosapara
runs wrote:Oh, any workaround to get all of them?
:-(


There are too many different mods with custom effect "on_eat". Write me to pm what is mods you want use with particles.

Re: [Mod] On eat [on_eat]

PostPosted: Sat May 18, 2019 07:59
by texmex
Why not just wrap any existing on_eat function and add this code?

Code: Select all
Like,
existing_on_eat = on_eat

on_eat = function()
  your stuff
  existing_on_eat()
end

Re: [Mod] On eat [on_eat]

PostPosted: Sat May 18, 2019 08:22
by runs
texmex wrote:Why not just wrap any existing on_eat function and add this code?

Code: Select all
Like,
existing_on_eat = on_eat

on_eat = function()
  your stuff
  existing_on_eat()
end


This is the way or in default mod.

Re: [Mod] On eat [on_eat]

PostPosted: Sat May 18, 2019 09:24
by bosapara
texmex wrote:Why not just wrap any existing on_eat function and add this code?

Some mods already use overwrite, so just easy add particles code to each mod

Re: [Mod] On eat [on_eat]

PostPosted: Sat May 18, 2019 16:50
by Joseph16
this is awesome! Now all we need is make it so eating takes a few seconds, and has a proper animation.

Re: [Mod] On eat [on_eat]

PostPosted: Sun May 19, 2019 17:32
by bosapara
Update
__________________________________________

- Added object collision and code reduced / optimized in 8x times

Image DOWNLOAD