Endedbox45 Posted December 1, 2017 Share Posted December 1, 2017 I'm still new to modding in don't starve but one of my character's downfalls are is that he'll get the drowsy status if it rains or it's summer. So how do I do that? I've provided the code so do what you wish. local MakePlayerCharacter = require "prefabs/player_common" local assets = { Asset("SCRIPT", "scripts/prefabs/player_common.lua"), } local prefabs = {} -- Custom starting items local start_inv = { "armorwood" , "spear" } -- When the character is revived from human local function onbecamehuman(inst) -- Set speed when reviving from ghost (optional) inst.components.locomotor:SetExternalSpeedMultiplier(inst, "esctemplate_speed_mod", 1.2) end local function onbecameghost(inst) -- Remove speed modifier when becoming a ghost inst.components.locomotor:RemoveExternalSpeedMultiplier(inst, "esctemplate_speed_mod") end -- When loading or spawning the character local function onload(inst) inst:ListenForEvent("ms_respawnedfromghost", onbecamehuman) inst:ListenForEvent("ms_becameghost", onbecameghost) if inst:HasTag("playerghost") then onbecameghost(inst) else onbecamehuman(inst) end end -- This initializes for both the server and client. Tags can be added here. local common_postinit = function(inst) -- Minimap icon inst.MiniMapEntity:SetIcon( "esctemplate.tex" ) end -- This initializes for the server only. Components are added here. local master_postinit = function(inst) -- choose which sounds this character will play inst.soundsname = "wilson" -- Uncomment if "wathgrithr"(Wigfrid) or "webber" voice is used --inst.talker_path_override = "dontstarve_DLC001/characters/" -- Stats inst.components.health:SetMaxHealth(125) inst.components.hunger:SetMax(150) inst.components.sanity:SetMax(125) inst.components.temperature.mintemp = 75 -- Damage multiplier (optional) inst.components.combat.damagemultiplier = 1.3 -- Hunger rate (optional) inst.components.hunger.hungerrate = 1.2 * TUNING.WILSON_HUNGER_RATE inst.OnLoad = onload inst.OnNewSpawn = onload end return MakePlayerCharacter("esctemplate", prefabs, assets, common_postinit, master_postinit, start_inv) Link to comment Share on other sites More sharing options...
Serpens Posted December 2, 2017 Share Posted December 2, 2017 I think you are looking for "grogginess" (not sure if correct spelled). Just search the game files with notepad++ to see how to use it. I think it is a component and has a function "AddGrogginess" which is what you are looking for. Link to comment Share on other sites More sharing options...
K1NGT1GER609 Posted December 3, 2017 Share Posted December 3, 2017 Here: local MakePlayerCharacter = require "prefabs/player_common" local assets = { Asset("SCRIPT", "scripts/prefabs/player_common.lua"), } local prefabs = {} -- Custom starting items local start_inv = { "armorwood" , "spear" } local function drowzy (inst) if TheWorld.state.issummer or (TheWorld.state.israining) then --inst.components.grogginess.grog_amount= 3 inst:AddTag("groggy") end end -- When the character is revived from human local function onbecamehuman(inst) -- Set speed when reviving from ghost (optional) inst.components.locomotor:SetExternalSpeedMultiplier(inst, "esctemplate_speed_mod", 1.2) end local function onbecameghost(inst) -- Remove speed modifier when becoming a ghost inst.components.locomotor:RemoveExternalSpeedMultiplier(inst, "esctemplate_speed_mod") end -- When loading or spawning the character local function onload(inst) inst:ListenForEvent("ms_respawnedfromghost", onbecamehuman) inst:ListenForEvent("ms_becameghost", onbecameghost) if inst:HasTag("playerghost") then onbecameghost(inst) else onbecamehuman(inst) end end -- This initializes for both the server and client. Tags can be added here. local common_postinit = function(inst) -- Minimap icon inst.MiniMapEntity:SetIcon( "esctemplate.tex" ) end -- This initializes for the server only. Components are added here. local master_postinit = function(inst) -- choose which sounds this character will play inst.soundsname = "wilson" -- Uncomment if "wathgrithr"(Wigfrid) or "webber" voice is used --inst.talker_path_override = "dontstarve_DLC001/characters/" -- Stats inst.components.health:SetMaxHealth(125) inst.components.hunger:SetMax(150) inst.components.sanity:SetMax(125) inst.components.temperature.mintemp = 75 -- Damage multiplier (optional) inst.components.combat.damagemultiplier = 1.3 -- Hunger rate (optional) inst.components.hunger.hungerrate = 1.2 * TUNING.WILSON_HUNGER_RATE inst.OnLoad = onload inst.OnNewSpawn = onload inst:DoPeriodicTask(1, drowzy, nil, inst) --check every second end return MakePlayerCharacter("esctemplate", prefabs, assets, common_postinit, master_postinit, start_inv) Link to comment Share on other sites More sharing options...
Kronas Posted December 7, 2017 Share Posted December 7, 2017 On 12/3/2017 at 7:35 AM, K1NGT1GER609 said: Here: local MakePlayerCharacter = require "prefabs/player_common" local assets = { Asset("SCRIPT", "scripts/prefabs/player_common.lua"), } local prefabs = {} -- Custom starting items local start_inv = { "armorwood" , "spear" } local function drowzy (inst) if TheWorld.state.issummer or (TheWorld.state.israining) then --inst.components.grogginess.grog_amount= 3 inst:AddTag("groggy") end end -- When the character is revived from human local function onbecamehuman(inst) -- Set speed when reviving from ghost (optional) inst.components.locomotor:SetExternalSpeedMultiplier(inst, "esctemplate_speed_mod", 1.2) end local function onbecameghost(inst) -- Remove speed modifier when becoming a ghost inst.components.locomotor:RemoveExternalSpeedMultiplier(inst, "esctemplate_speed_mod") end -- When loading or spawning the character local function onload(inst) inst:ListenForEvent("ms_respawnedfromghost", onbecamehuman) inst:ListenForEvent("ms_becameghost", onbecameghost) if inst:HasTag("playerghost") then onbecameghost(inst) else onbecamehuman(inst) end end -- This initializes for both the server and client. Tags can be added here. local common_postinit = function(inst) -- Minimap icon inst.MiniMapEntity:SetIcon( "esctemplate.tex" ) end -- This initializes for the server only. Components are added here. local master_postinit = function(inst) -- choose which sounds this character will play inst.soundsname = "wilson" -- Uncomment if "wathgrithr"(Wigfrid) or "webber" voice is used --inst.talker_path_override = "dontstarve_DLC001/characters/" -- Stats inst.components.health:SetMaxHealth(125) inst.components.hunger:SetMax(150) inst.components.sanity:SetMax(125) inst.components.temperature.mintemp = 75 -- Damage multiplier (optional) inst.components.combat.damagemultiplier = 1.3 -- Hunger rate (optional) inst.components.hunger.hungerrate = 1.2 * TUNING.WILSON_HUNGER_RATE inst.OnLoad = onload inst.OnNewSpawn = onload inst:DoPeriodicTask(1, drowzy, nil, inst) --check every second end return MakePlayerCharacter("esctemplate", prefabs, assets, common_postinit, master_postinit, start_inv) but of course he will have to change the esctemplate with the character name right ? Link to comment Share on other sites More sharing options...
K1NGT1GER609 Posted December 8, 2017 Share Posted December 8, 2017 Well yeah if ur an experienced modder but usually when some one leaves the esctemplate its usually someone starting off on moding. Link to comment 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