Jump to content

Recommended Posts

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

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.

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

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.

  • Like 1

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...