WORLDSBIGGEST Posted May 18, 2016 Share Posted May 18, 2016 The character in my mod has fur, so I would like for her to start freezing slower and overheating faster. What would be the best way to go about it? Link to comment https://forums.kleientertainment.com/forums/topic/67411-modding-custom-character-temperature/ Share on other sites More sharing options...
DrSmugleaf Posted May 18, 2016 Share Posted May 18, 2016 (edited) 1 hour ago, WORLDSBIGGEST said: The character in my mod has fur, so I would like for her to start freezing slower and overheating faster. What would be the best way to go about it? -- Winter insulation only affects you when it's cold out, summer insulation only helps when it's warm inst.components.temperature.inherentinsulation = 60 inst.components.temperature.inherentsummerinsulation = -60 Use whatever numbers you want there. For comparison, Wilson's beard gives 15-45-135 insulation. However Wilson's insulation does affect both winter insulation and summer insulation, hurting against the latter. Edited May 18, 2016 by DrSmugleaf Link to comment https://forums.kleientertainment.com/forums/topic/67411-modding-custom-character-temperature/#findComment-773244 Share on other sites More sharing options...
WORLDSBIGGEST Posted May 20, 2016 Author Share Posted May 20, 2016 That worked perfectly, thank you! Not to be a bother but I'm trying to code another mechanic and keep getting an error message I don't understand. Quote [00:00:57]: Mod: Mina (mina) Error loading mod! [string "../mods/Mina/modmain.lua"]:112: 'end' expected (to close 'function' at line 98) near 'local' Which refers to these lines of code: local function fn() inst:AddTag("HASHEATER") inst.entity:SetPristine() if not TheWorld.ismastersim then return inst end inst:AddComponent("heater") inst.components.heater.heatfn = GetHeatFn return inst local heats = { 50, 60, 80 } end local function GetHeatFn(inst) return heats or 40 end Basically I want other characters temperatures to increase if they're standing near her(she's a healer in the original game I made her for, this was the best way I could think of to carry that over without getting cheap), but I'm not sure what's wrong with my 'end' placement. :S Link to comment https://forums.kleientertainment.com/forums/topic/67411-modding-custom-character-temperature/#findComment-774012 Share on other sites More sharing options...
Aquaterion Posted May 20, 2016 Share Posted May 20, 2016 (edited) 21 minutes ago, WORLDSBIGGEST said: That worked perfectly, thank you! Not to be a bother but I'm trying to code another mechanic and keep getting an error message I don't understand. Which refers to these lines of code: local function fn() inst:AddTag("HASHEATER") inst.entity:SetPristine() if not TheWorld.ismastersim then return inst end inst:AddComponent("heater") inst.components.heater.heatfn = GetHeatFn return inst local heats = { 50, 60, 80 } end local function GetHeatFn(inst) return heats or 40 end Basically I want other characters temperatures to increase if they're standing near her(she's a healer in the original game I made her for, this was the best way I could think of to carry that over without getting cheap), but I'm not sure what's wrong with my 'end' placement. :S move "local heats = { 50, 60, 80 }" to outside the function also move the GetHeatFn to above the fn function Edited May 20, 2016 by Aquaterion Link to comment https://forums.kleientertainment.com/forums/topic/67411-modding-custom-character-temperature/#findComment-774025 Share on other sites More sharing options...
WORLDSBIGGEST Posted May 20, 2016 Author Share Posted May 20, 2016 49 minutes ago, Aquaterion said: move "local heats = { 50, 60, 80 }" to outside the function also move the GetHeatFn to above the fn function Sorry for the slow reply, but this did the trick! thank you! (also i dont think i thanked you last time you helped me with a coding issue so a belated thanks for that too!) Link to comment https://forums.kleientertainment.com/forums/topic/67411-modding-custom-character-temperature/#findComment-774034 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