Codina Posted March 15, 2019 Share Posted March 15, 2019 I want to make a mod that when you eat specific food it gives you a small buff. Example: when you eat spicy chili it gives you 10x damage modifier and plays the Wolfgang flexing animation. The damage modifier lasts for 4 minutes. I would have to type my own script for this right? Link to comment Share on other sites More sharing options...
Ultroman Posted March 15, 2019 Share Posted March 15, 2019 Yes, you will have to make your own script for this, using AddPlayerPostInit where you extend the Eat function of the eater-component, and make it do something special if the eating is successful. I am sorry, but I don't have time to help in-depth atm, but here's a link to my newcomer post. It should help you get started. Something like this, though: AddPlayerPostInit(function(inst) if inst.components.eater then local old_Eat = inst.components.Eat inst.components.Eat = function(food, feeder, ...) if old_Eat(food, feeder, ...) -- Do your stuff in here. end end end end) The stuff you need to do, would be something like adding an extra multiplier to externaldamagemultipliers in the combat component, and then do a DoTaskInTime() call with a function which removes the multiplier again. Link to comment Share on other sites More sharing options...
Codina Posted March 16, 2019 Author Share Posted March 16, 2019 (edited) 11 hours ago, Ultroman said: Yes, you will have to make your own script for this, using AddPlayerPostInit where you extend the Eat function of the eater-component, and make it do something special if the eating is successful. I am sorry, but I don't have time to help in-depth atm, but here's a link to my newcomer post. It should help you get started. Something like this, though: AddPlayerPostInit(function(inst) if inst.components.eater then local old_Eat = inst.components.Eat inst.components.Eat = function(food, feeder, ...) if old_Eat(food, feeder, ...) -- Do your stuff in here. end end end end) The stuff you need to do, would be something like adding an extra multiplier to externaldamagemultipliers in the combat component, and then do a DoTaskInTime() call with a function which removes the multiplier again. I looked into Tykvesh's Battle Horn mod script as a reference because it uses the similar mechanics. https://steamcommunity.com/sharedfiles/filedetails/?id=906612255&searchtext=horn I've only able to learn the commands for adding variables and text at the moment Edited March 16, 2019 by Codina Link to comment Share on other sites More sharing options...
Ultroman Posted March 16, 2019 Share Posted March 16, 2019 OK. Come back if you have some questions we can help with. Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now