[Mod] On eat [on_eat]

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

[Mod] On eat [on_eat]

by bosapara » Thu May 16, 2019 09:28

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: 1588
Joined: Mon Jul 11, 2016 21:08
GitHub: tacotexmex
In-game: texmex

Re: [Mod] On eat [on_eat]

by texmex » Thu May 16, 2019 16:42

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: 529
Joined: Fri Apr 07, 2017 08:49
GitHub: bosapara

Re: [Mod] On eat [on_eat]

by bosapara » Fri May 17, 2019 09:39

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: 886
Joined: Sat Oct 27, 2018 08:32
GitHub: runsy

Re: [Mod] On eat [on_eat]

by runs » Fri May 17, 2019 09:47

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

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

Re: [Mod] On eat [on_eat]

by bosapara » Fri May 17, 2019 09:56

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: 886
Joined: Sat Oct 27, 2018 08:32
GitHub: runsy

Re: [Mod] On eat [on_eat]

by runs » Fri May 17, 2019 21:52

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: 529
Joined: Fri Apr 07, 2017 08:49
GitHub: bosapara

Re: [Mod] On eat [on_eat]

by bosapara » Sat May 18, 2019 06:48

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: 1588
Joined: Mon Jul 11, 2016 21:08
GitHub: tacotexmex
In-game: texmex

Re: [Mod] On eat [on_eat]

by texmex » Sat May 18, 2019 07:59

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: 886
Joined: Sat Oct 27, 2018 08:32
GitHub: runsy

Re: [Mod] On eat [on_eat]

by runs » Sat May 18, 2019 08:22

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: 529
Joined: Fri Apr 07, 2017 08:49
GitHub: bosapara

Re: [Mod] On eat [on_eat]

by bosapara » Sat May 18, 2019 09:24

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: 308
Joined: Tue Dec 06, 2016 05:35
In-game: Joseph16

Re: [Mod] On eat [on_eat]

by Joseph16 » Sat May 18, 2019 16:50

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: 529
Joined: Fri Apr 07, 2017 08:49
GitHub: bosapara

Re: [Mod] On eat [on_eat]

by bosapara » Sun May 19, 2019 17:32

Update
__________________________________________

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

Image DOWNLOAD
 


Return to WIP Mods



Who is online

Users browsing this forum: MSN [Bot] and 6 guests