FryoKnight Posted October 9, 2015 Share Posted October 9, 2015 So, at the moment, I am currently making a mod that will add all sort of things, mostly chest related, into the game. But at the moment I am stuck on one I am working on.You see, I am making a object that cooks any food that you put it (not Crockpot cook, but like Raw Meat to Cooked Meat), which I can figure out, but I also want to make it where if the person leaves the food in there, it will perish multiplier rate of 2. So far, the highest I have found for perish (excluding RoG) is "PERISH_GROUND_MULT = 1.5"... I really can't change that without messing with the rest of normal game play, so does anyone know how I can create something that allows for a Perish rate of x2? Link to comment https://forums.kleientertainment.com/forums/topic/58382-helpds-making-a-mod-but-having-issues-figure-out-something-with-perishables/ Share on other sites More sharing options...
expert975 Posted October 9, 2015 Share Posted October 9, 2015 There's a mod called "Additional Structures" for Don't Starve that adds a thing called the "perish box", it causes things to spoils faster. Link to comment https://forums.kleientertainment.com/forums/topic/58382-helpds-making-a-mod-but-having-issues-figure-out-something-with-perishables/#findComment-678806 Share on other sites More sharing options...
FryoKnight Posted October 9, 2015 Author Share Posted October 9, 2015 There's a mod called "Additional Structures" for Don't Starve that adds a thing called the "perish box", it causes things to spoils faster.Well, I went and looked at that mod, but it changes the perishable.lua file, which I am trying to avoid (seeing as it can make things incompatible). Though, it seems it might be the only thing I can do. .-. Link to comment https://forums.kleientertainment.com/forums/topic/58382-helpds-making-a-mod-but-having-issues-figure-out-something-with-perishables/#findComment-678812 Share on other sites More sharing options...
Mobbstar Posted October 9, 2015 Share Posted October 9, 2015 How does the icebox do it? Surely you can "extend" perishable.lua to consider your thing. Link to comment https://forums.kleientertainment.com/forums/topic/58382-helpds-making-a-mod-but-having-issues-figure-out-something-with-perishables/#findComment-678840 Share on other sites More sharing options...
Blueberrys Posted October 10, 2015 Share Posted October 10, 2015 How does the icebox do it? It modifies the local function "Update" in perishable.lua by overriding the file. The Update function is (originally) called within multiple functions in the perishable.lua file itself. (Perishable:LongUpdate and Perishable:StartPerishing) @FryoKnight Perhaps you'd wanna consider changing perishable.perishtime and perishable.perishremainingtime instead? It's kinda hacky, but somewhat more reliable than changing the whole file.local function CustomPerish(inst, data) -- inst = instance of item that can perish -- data.percent = current perish percent -- You can modify perishtime, use perishable:ReducePercent, or perishable:SetPercent -- Remember to calculate it properly according to the old percentageend-- inst = instance of item that can perish-- Start listening (and modifying)-- When item is put into the boxinst:ListenForEvent("perishchange", CustomPerish)-- Stop listening-- When item is removed from the boxinst::RemoveEventCallback("perishchange", CustomPerish)Check "..\components\perishable.lua" to see how the component works. Link to comment https://forums.kleientertainment.com/forums/topic/58382-helpds-making-a-mod-but-having-issues-figure-out-something-with-perishables/#findComment-678989 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