bigpak Posted January 11, 2015 Share Posted January 11, 2015 I am fairly sure it is this inst.components.hunger:SetRate(rate) however, I am confused on one thing, if I set it to 1, it drains incredibly fast and at 10 points per drain I believe, if I wanted it to be 3 times as fast as normal, would it not be 0.3 or would it be 3? If I set it to 3 it still drains insanely fast, way faster than wolfgang does in his mighty state. Link to comment https://forums.kleientertainment.com/forums/topic/48897-hunger-drain-rate/ Share on other sites More sharing options...
Blueberrys Posted January 11, 2015 Share Posted January 11, 2015 (edited) tuning.lua contains:local seg_time = 30local total_day_time = seg_time*16...local calories_per_day = 75...WILSON_HUNGER_RATE = calories_per_day/total_day_time, --calories burnt per day...WOLFGANG_HUNGER_RATE_MULT_MIGHTY = 3,WOLFGANG_HUNGER_RATE_MULT_NORMAL = 1.5,WOLFGANG_HUNGER_RATE_MULT_WIMPY = 1,And wolfgang.lua:local hunger_rate = TUNING.WOLFGANG_HUNGER_RATE_MULT_NORMAL...inst.components.hunger:SetRate(hunger_rate*TUNING.WILSON_HUNGER_RATE)Doing the math: seg_time = 30total_day_time = seg_time*16 = 480calories_per_day = 75 hunger_rate = TUNING.WOLFGANG_HUNGER_RATE_MULT_NORMAL = 1.5TUNING.WILSON_HUNGER_RATE = calories_per_day/total_day_time = 75/480 = 0.15625 normal_rate = hunger_rate*TUNING.WILSON_HUNGER_RATE = 1.5 * 0.15625 = 0.234375 If you want 3*normal_rate of wolfgang, that would be 0.703125 But it would be better if you didn't hard-code the number. Make it a variable as it's done for the other characters.Use TUNING.WILSON_HUNGER_RATE * 3 to get 3 times the normal rate of wilson. GLOBAL.TUNING.YOUR_CHARACTER_HUNGER_RATE = TUNING.WILSON_HUNGER_RATE * 3-- ...-- Somewhere inside your create fn, ideallyinst.components.hunger:SetRate(GLOBAL.TUNING.YOUR_CHARACTER_HUNGER_RATE) Edited January 11, 2015 by Blueberrys Link to comment https://forums.kleientertainment.com/forums/topic/48897-hunger-drain-rate/#findComment-600085 Share on other sites More sharing options...
bigpak Posted January 11, 2015 Author Share Posted January 11, 2015 (edited) tuning.lua contains:local seg_time = 30local total_day_time = seg_time*16...local calories_per_day = 75...WILSON_HUNGER_RATE = calories_per_day/total_day_time, --calories burnt per day...WOLFGANG_HUNGER_RATE_MULT_MIGHTY = 3,WOLFGANG_HUNGER_RATE_MULT_NORMAL = 1.5,WOLFGANG_HUNGER_RATE_MULT_WIMPY = 1,And wolfgang.lua:local hunger_rate = TUNING.WOLFGANG_HUNGER_RATE_MULT_NORMAL...inst.components.hunger:SetRate(hunger_rate*TUNING.WILSON_HUNGER_RATE)Doing the math: seg_time = 30total_day_time = seg_time*16 = 480calories_per_day = 75 hunger_rate = TUNING.WOLFGANG_HUNGER_RATE_MULT_NORMAL = 1.5TUNING.WILSON_HUNGER_RATE = calories_per_day/total_day_time = 75/480 = 0.15625 normal_rate = hunger_rate*TUNING.WILSON_HUNGER_RATE = 1.5 * 0.15625 = 0.234375 If you want 3*normal_rate of wolfgang, that would be 0.703125 But it would be better if you didn't hard-code the number. Make it a variable as it's done for the other characters.Use TUNING.WILSON_HUNGER_RATE * 3 to get 3 times the normal rate of wilson. GLOBAL.TUNING.YOUR_CHARACTER_HUNGER_RATE = TUNING.WILSON_HUNGER_RATE * 3-- ...-- Somewhere inside your create fn, ideallyinst.components.hunger:SetRate(GLOBAL.TUNING.YOUR_CHARACTER_HUNGER_RATE) Wow! Thank you so much! I will go ahead and test the tuning.wilson and see what that turns up! EDIT: Well then, It appears I owe you one. It works amazingly! Thank you so much! Edited January 11, 2015 by bigpak Link to comment https://forums.kleientertainment.com/forums/topic/48897-hunger-drain-rate/#findComment-600089 Share on other sites More sharing options...
bigpak Posted January 11, 2015 Author Share Posted January 11, 2015 (edited) Er, one last question, where exactly is tuning.lua getting its information from? if wilsons TUNING.WILSON_HUNGERRATE = 1 where is the number one located, specifically where is it getting the math for it from or the code for that from? EDIT: Oh, sorry for doubleposting, meant to hit edit, also I found it, nevermind WILSON_HUNGER_RATE = calories_per_day/total_day_time, --calories burnt per day Edited January 11, 2015 by bigpak Link to comment https://forums.kleientertainment.com/forums/topic/48897-hunger-drain-rate/#findComment-600091 Share on other sites More sharing options...
Blueberrys Posted January 11, 2015 Share Posted January 11, 2015 (edited) @bigpak, no prob! All the lua files are located in your game folder.Default locations, if you haven't changed it yourself: Steam/Windows: C:\Program Files (x86)\Steam\SteamApps\common\dont_starve\Standalone/Windows: C:\Program Files\dontstarve\modsStandalone/Mac: /Applications/Don't Starve/Don't Starve.app/Contents/Steam/Linux: /home/username/.local/share/Steam/SteamApps/common/dont_starve "..\scripts\tuning.lua""..\scripts\prefabs\wolfgang.lua"Other characters are also in "..\scripts\prefabs" with corresponding names. (playable maxwell is named waxwell) Edit: Sorry, misunderstood your question. If there's a variable being used in any file, just use ctrl+f and search it. Usually you'll find it declared in the same file. Edited January 11, 2015 by Blueberrys Link to comment https://forums.kleientertainment.com/forums/topic/48897-hunger-drain-rate/#findComment-600095 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