[Mod] On eat [on_eat]

Post Reply
User avatar
bosapara
Member
Posts: 637
Joined: Fri Apr 07, 2017 08:49

[Mod] On eat [on_eat]

by bosapara » Post

On Eat
___________________________________________________________________________________________________

Image Download | Github


"Minecraft like" particles idea for eating

Image

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

Image
Last edited by bosapara on Wed Jun 05, 2019 18:16, edited 3 times in total.

User avatar
texmex
Member
Posts: 1753
Joined: Mon Jul 11, 2016 21:08
GitHub: tacotexmex
In-game: tacotexmex

Re: [Mod] On eat [on_eat]

by texmex » Post

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.

User avatar
bosapara
Member
Posts: 637
Joined: Fri Apr 07, 2017 08:49

Re: [Mod] On eat [on_eat]

by bosapara » Post

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

User avatar
runs
Member
Posts: 3225
Joined: Sat Oct 27, 2018 08:32

Re: [Mod] On eat [on_eat]

by runs » Post

It does not work for me. Maybe it conflicts with Default or another mod, I do not know.

User avatar
bosapara
Member
Posts: 637
Joined: Fri Apr 07, 2017 08:49

Re: [Mod] On eat [on_eat]

by bosapara » Post

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

User avatar
runs
Member
Posts: 3225
Joined: Sat Oct 27, 2018 08:32

Re: [Mod] On eat [on_eat]

by runs » Post

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?
:-(

User avatar
bosapara
Member
Posts: 637
Joined: Fri Apr 07, 2017 08:49

Re: [Mod] On eat [on_eat]

by bosapara » Post

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.

User avatar
texmex
Member
Posts: 1753
Joined: Mon Jul 11, 2016 21:08
GitHub: tacotexmex
In-game: tacotexmex

Re: [Mod] On eat [on_eat]

by texmex » Post

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

User avatar
runs
Member
Posts: 3225
Joined: Sat Oct 27, 2018 08:32

Re: [Mod] On eat [on_eat]

by runs » Post

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.

User avatar
bosapara
Member
Posts: 637
Joined: Fri Apr 07, 2017 08:49

Re: [Mod] On eat [on_eat]

by bosapara » Post

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

User avatar
Joseph16
Member
Posts: 310
Joined: Tue Dec 06, 2016 05:35
In-game: smb3

Re: [Mod] On eat [on_eat]

by Joseph16 » Post

this is awesome! Now all we need is make it so eating takes a few seconds, and has a proper animation.
Testin' mines since 1989

User avatar
bosapara
Member
Posts: 637
Joined: Fri Apr 07, 2017 08:49

Re: [Mod] On eat [on_eat]

by bosapara » Post

Update
__________________________________________

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

Image DOWNLOAD

Post Reply

Who is online

Users browsing this forum: Mr. Rar and 38 guests