Enderia Posted May 23, 2022 Share Posted May 23, 2022 My custom food has the "buff_workeffectiveness" effect. I need help with adding a timer for it, because I never worked with time before and I dont understand it at all. I thought about making them as something similar to Honey Crystals, but in the original code I couldn't figure out time, so now once you eat them you're buffed forever. sundrops.lua Link to comment https://forums.kleientertainment.com/forums/topic/140429-adding-time/ Share on other sites More sharing options...
Leonidas IV Posted May 23, 2022 Share Posted May 23, 2022 I didn't find where the buff time is set, but maybe these files will help you: spicedfoods.lua (Add debuff to player) entityscript.lua (Has the function used in spicedfoods.lua) debuffable.lua (is used by function in entityscript) You can take a look at mods that show these buff time values and see where they were taken from. Link to comment https://forums.kleientertainment.com/forums/topic/140429-adding-time/#findComment-1572613 Share on other sites More sharing options...
Enderia Posted May 24, 2022 Author Share Posted May 24, 2022 20 hours ago, Leonidas IV said: I didn't find where the buff time is set, but maybe these files will help you: spicedfoods.lua (Add debuff to player) entityscript.lua (Has the function used in spicedfoods.lua) debuffable.lua (is used by function in entityscript) You can take a look at mods that show these buff time values and see where they were taken from. I can't find anything helpful in either of these files, I'll try the mods Link to comment https://forums.kleientertainment.com/forums/topic/140429-adding-time/#findComment-1572770 Share on other sites More sharing options...
Enderia Posted May 24, 2022 Author Share Posted May 24, 2022 1 hour ago, Enderia said: I can't find anything helpful in either of these files, I'll try the mods No such'a luck. I don't understand time enough to even copy it from mods Link to comment https://forums.kleientertainment.com/forums/topic/140429-adding-time/#findComment-1572779 Share on other sites More sharing options...
-LukaS- Posted May 24, 2022 Share Posted May 24, 2022 buff_workeffectiveness has its duration set up in foodbuffs.lua. It's a tuning value - TUNING.BUFF_WORKEFFECTIVENESS_DURATION and it's equal to total_day_time * .5, so half of a day. So if you're using this exact buff you don't need to add a timer for it. If you were to use a different buff or perhaps create your own buff look through foodbuffs.lua. 1 Link to comment https://forums.kleientertainment.com/forums/topic/140429-adding-time/#findComment-1572805 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