Yakuzashi Posted May 22, 2018 Share Posted May 22, 2018 (edited) Hi everyone, I need help with error in my character mod based on extended sample character template. So my character works almost flawless, but there is one defect - character's stats didn't change at all: movement speed, attack multiplier, health, sanity, hunger. I don't know how to fix it. Please don't let me go insane, I am losing my mind. EDIT: I figured out that the bug is in this sector local master_postinit = function(inst) everything out of this grup works fine swin.lua Edited May 22, 2018 by Yakuzashi + info Link to comment https://forums.kleientertainment.com/forums/topic/91017-dst-stats-error/ Share on other sites More sharing options...
RedHairedHero Posted May 22, 2018 Share Posted May 22, 2018 If you can share what you have it'll be easier to troubleshoot the issue. Link to comment https://forums.kleientertainment.com/forums/topic/91017-dst-stats-error/#findComment-1037134 Share on other sites More sharing options...
Yakuzashi Posted May 22, 2018 Author Share Posted May 22, 2018 I've updated it Link to comment https://forums.kleientertainment.com/forums/topic/91017-dst-stats-error/#findComment-1037137 Share on other sites More sharing options...
RedHairedHero Posted May 22, 2018 Share Posted May 22, 2018 You need to add return inst to the very bottom of your master_postinit function. local master_postinit = function(inst) -- choose which sounds this character will play inst.soundsname = "willow" -- Uncomment if "wathgrithr"(Wigfrid) or "webber" voice is used --inst.talker_path_override = "dontstarve_DLC001/characters/" -- Stats inst.components.health:SetMaxHealth(100) inst.components.hunger:SetMax(150) inst.components.sanity:SetMax(300) -- Damage multiplier (optional) inst.components.combat.damagemultiplier = 1.15 -- Rain resistance [speed of getting wet] (0 = rainproof, 0.75 = normal value_) inst.components.moisture.maxMoistureRate = 0.375 -- 50% slower rain weting rate -- Hunger rate (optional) inst.components.hunger.hungerrate = 1.1 * TUNING.WILSON_HUNGER_RATE -- Cold resistance (10 Degrees per 50 seconds, [without this line -> 10 degrees per 20 seconds] inst.components.temperature.inherentinsulation = TUNING.INSULATION_MED --Ambush by Cherry (Steam) [Thank you very much- great modder] inst:DoPeriodicTask(0.1, function() local CAN_ATTACK = { CHOP = false, DIG = false, HAMMER = false, MINE = false, ATTACK = true, } local ATTACK_TAGS = {"_combat"} for k, v in pairs(CAN_ATTACK) do table.insert(ATTACK_TAGS, k.."_workable") end local NON_ATTACK_TAGS = {"INLIMBO", "playerghost"} local x, y, z = inst.Transform:GetWorldPosition() local ents = TheSim:FindEntities(x, y, z, 2.5, nil, NON_ATTACK_TAGS, ATTACK_TAGS) for i, v in ipairs(ents) do if not v:HasTag("player") and not v:HasTag("shadow") and not v:HasTag("shadowminion") and not v:HasTag("shadowchesspiece") and v.components.health and not v.components.health:IsDead() and inst.components.health and not inst.components.health:IsDead() then -- No hiding from nightmare creatures, mwuhahaha! inst:RemoveTag("notarget") inst:AddTag("scarytoprey") else inst:AddTag("notarget") inst:RemoveTag("scarytoprey") end end end) inst.OnLoad = onload inst.OnNewSpawn = onload return inst end  Link to comment https://forums.kleientertainment.com/forums/topic/91017-dst-stats-error/#findComment-1037141 Share on other sites More sharing options...
Yakuzashi Posted May 22, 2018 Author Share Posted May 22, 2018 (edited) God bless you ! I will try it asap  It didn't work. I have coppied everything like you posted. Edited May 22, 2018 by Yakuzashi Link to comment https://forums.kleientertainment.com/forums/topic/91017-dst-stats-error/#findComment-1037144 Share on other sites More sharing options...
Yakuzashi Posted May 22, 2018 Author Share Posted May 22, 2018 I have uploaded whole modfile, maybe this error is caused by some other files. Swin-over.zip Link to comment https://forums.kleientertainment.com/forums/topic/91017-dst-stats-error/#findComment-1037169 Share on other sites More sharing options...
RedHairedHero Posted May 22, 2018 Share Posted May 22, 2018 1 minute ago, Yakuzashi said: I have uploaded whole modfile, maybe this error is caused by some other files. Swin-over.zip Are you getting an error message as well? If so you can find your error log inside My Documents>Klei>Don't Starve Together > client_log.txt  Link to comment https://forums.kleientertainment.com/forums/topic/91017-dst-stats-error/#findComment-1037171 Share on other sites More sharing options...
Yakuzashi Posted May 22, 2018 Author Share Posted May 22, 2018 I have no error message and crashes at all. Link to comment https://forums.kleientertainment.com/forums/topic/91017-dst-stats-error/#findComment-1037172 Share on other sites More sharing options...
RedHairedHero Posted May 22, 2018 Share Posted May 22, 2018 -- This initializes for the server only. Components are added here. local master_postinit = function(inst) -- choose which sounds this character will play inst.soundsname = "wendy" -- Uncomment if "wathgrithr"(Wigfrid) or "webber" voice is used --inst.talker_path_override = "dontstarve_DLC001/characters/" -- Stats inst.components.health:SetMaxHealth(100) inst.components.hunger:SetMax(150) inst.components.sanity:SetMax(300) -- Damage multiplier (optional) inst.components.combat.damagemultiplier = 1.15 -- Rain resistance [speed of getting wet] (0 = rainproof, 0.75 = normal value_) inst.components.moisture.maxMoistureRate = 0.375 -- 50% slower rain weting rate -- Hunger rate (optional) inst.components.hunger.hungerrate = 1.1 * TUNING.WILSON_HUNGER_RATE -- Cold resistance (10 Degrees per 50 seconds, [without this line -> 10 degrees per 20 seconds] inst.components.temperature.inherentinsulation = TUNING.INSULATION_MED --Ambush by Cherry (Steam) [Thank you very much- great modder] inst:DoPeriodicTask(0.1, function() local CAN_ATTACK = { CHOP = false, DIG = false, HAMMER = false, MINE = false, ATTACK = true, } local ATTACK_TAGS = {"_combat"} for k, v in pairs(CAN_ATTACK) do table.insert(ATTACK_TAGS, k.."_workable") end local NON_ATTACK_TAGS = {"INLIMBO", "playerghost"} local x, y, z = inst.Transform:GetWorldPosition() local ents = TheSim:FindEntities(x, y, z, 2.5, nil, NON_ATTACK_TAGS, ATTACK_TAGS) for i, v in ipairs(ents) do if not v:HasTag("player") and not v:HasTag("shadow") and not v:HasTag("shadowminion") and not v:HasTag("shadowchesspiece") and v.components.health and not v.components.health:IsDead() and inst.components.health and not inst.components.health:IsDead() then -- No hiding from nightmare creatures, mwuhahaha! inst:RemoveTag("notarget") inst:AddTag("scarytoprey") else inst:AddTag("notarget") inst:RemoveTag("scarytoprey") end end end) inst.OnLoad = onload inst.OnNewSpawn = onload return inst end --Recipes knowledge ( inst.components.builder.science_bonus = 1 -> science machine [2-> alchemy enginge] ) local function master_postinit(inst) inst.components.builder.science_bonus = 1 end Here's the problem, you have 2 master_postinit functions when you should only have 1. Just update it to this. -- This initializes for the server only. Components are added here. local master_postinit = function(inst) -- choose which sounds this character will play inst.soundsname = "wendy" -- Uncomment if "wathgrithr"(Wigfrid) or "webber" voice is used --inst.talker_path_override = "dontstarve_DLC001/characters/" -- Stats inst.components.health:SetMaxHealth(100) inst.components.hunger:SetMax(150) inst.components.sanity:SetMax(300) -- Damage multiplier (optional) inst.components.combat.damagemultiplier = 1.15 -- Rain resistance [speed of getting wet] (0 = rainproof, 0.75 = normal value_) inst.components.moisture.maxMoistureRate = 0.375 -- 50% slower rain weting rate -- Hunger rate (optional) inst.components.hunger.hungerrate = 1.1 * TUNING.WILSON_HUNGER_RATE -- Cold resistance (10 Degrees per 50 seconds, [without this line -> 10 degrees per 20 seconds] inst.components.temperature.inherentinsulation = TUNING.INSULATION_MED --Ambush by Cherry (Steam) [Thank you very much- great modder] inst:DoPeriodicTask(0.1, function() local CAN_ATTACK = { CHOP = false, DIG = false, HAMMER = false, MINE = false, ATTACK = true, } local ATTACK_TAGS = {"_combat"} for k, v in pairs(CAN_ATTACK) do table.insert(ATTACK_TAGS, k.."_workable") end local NON_ATTACK_TAGS = {"INLIMBO", "playerghost"} local x, y, z = inst.Transform:GetWorldPosition() local ents = TheSim:FindEntities(x, y, z, 2.5, nil, NON_ATTACK_TAGS, ATTACK_TAGS) for i, v in ipairs(ents) do if not v:HasTag("player") and not v:HasTag("shadow") and not v:HasTag("shadowminion") and not v:HasTag("shadowchesspiece") and v.components.health and not v.components.health:IsDead() and inst.components.health and not inst.components.health:IsDead() then -- No hiding from nightmare creatures, mwuhahaha! inst:RemoveTag("notarget") inst:AddTag("scarytoprey") else inst:AddTag("notarget") inst:RemoveTag("scarytoprey") end end end) --Recipes knowledge ( inst.components.builder.science_bonus = 1 -> science machine [2-> alchemy enginge] ) inst.components.builder.science_bonus = 1 inst.OnLoad = onload inst.OnNewSpawn = onload return inst end That should fix the issue. Link to comment https://forums.kleientertainment.com/forums/topic/91017-dst-stats-error/#findComment-1037174 Share on other sites More sharing options...
Yakuzashi Posted May 22, 2018 Author Share Posted May 22, 2018 Okay. Thank you very much. It works perfect. You are great man ! Link to comment https://forums.kleientertainment.com/forums/topic/91017-dst-stats-error/#findComment-1037179 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