Jump to content

UseItem / OnEat event?


Arithmechick

Recommended Posts

I want to call a function anytime the player eats any food item. Is there any way to do this?

 

The modding wiki lists a now-obsolete UseItem event. Is there some other event I should be using instead?

 

Edit: Solved. I realized I could accomplish this by overriding the vanilla ISEatFoodAction.perform method, i.e.

 

--Override vanilla function
local base_perform = ISEatFoodAction.perform

function ISEatFoodAction:perform()    
    base_perform(self)    
	doSomething(self.item, self.character)
end

 

Edited by Arithmechick
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...