KashiKakes Posted December 16, 2014 Share Posted December 16, 2014 Hello! I'm not a coder by any means, I mean I can do the most basic things like finding a couple lines and changing them to change a character's name or dialogue, but I was hoping to make a couple custom traits for my character. I was wondering if someone could provide the code to give a character the following traits some sort of modifier where he loses twice as much sanity when near spiders since he's arachnaphobic, and increased sanity loss at night due to being afraid of the dark. I was also wondering if it would be possible to make it so that rabbits wouldn't be scared of him, or would that require also editing the rabbit's files? if anyone would be so kind I would be eternally grateful Link to comment Share on other sites More sharing options...
Silentdarkness1 Posted December 17, 2014 Share Posted December 17, 2014 Well, that'd be as simple as adding a few components that change the spider and rabbit prefabs. Give the spiders a super nasty negative sanity aura, and remove the fleeing from the rabbits. That would require changing the files tho, i think. Link to comment Share on other sites More sharing options...
KashiKakes Posted December 17, 2014 Author Share Posted December 17, 2014 I was hoping to make this character work in Don't Starve together, so hopefully it would only affect this character specifically Link to comment Share on other sites More sharing options...
Dryicefox Posted December 17, 2014 Share Posted December 17, 2014 I was hoping to make this character work in Don't Starve together, so hopefully it would only affect this character specifically Easy, look at Winnie from Up and Away to find the bunnie thing and do this for the spiders in your mod main local function eekaspider(inst) if ThePlayer.prefab == "charactername" then inst:AddComponent("sanityaura") inst.components.sanityaura.aura = (TUNING.SANITYAURA_SMALL * amount) else endend AddPrefabPostInit('spider', eekaspider) Link to comment Share on other sites More sharing options...
KashiKakes Posted December 17, 2014 Author Share Posted December 17, 2014 sweet thank you! Link to comment Share on other sites More sharing options...
KashiKakes Posted December 17, 2014 Author Share Posted December 17, 2014 wait I'm a little confused with the Winnie mod, is it possible to make rabbits not run away but penguins still act the same? Link to comment Share on other sites More sharing options...
Dryicefox Posted December 17, 2014 Share Posted December 17, 2014 wait I'm a little confused with the Winnie mod, is it possible to make rabbits not run away but penguins still act the same?Idunno Link to comment Share on other sites More sharing options...
Rincevvind Posted December 18, 2014 Share Posted December 18, 2014 wait I'm a little confused with the Winnie mod, is it possible to make rabbits not run away but penguins still act the same? Rabbits run away if you have "monster" tag, pengulls don't care as i remember. Link to comment Share on other sites More sharing options...
KashiKakes Posted December 18, 2014 Author Share Posted December 18, 2014 how can I remove that tag from my character? Link to comment Share on other sites More sharing options...
KashiKakes Posted December 18, 2014 Author Share Posted December 18, 2014 also if anyone can help me once more I had an idea for another trait anyone know how to make it so that a character would not lose sanity from using wormholes? Link to comment Share on other sites More sharing options...
KashiKakes Posted December 19, 2014 Author Share Posted December 19, 2014 Easy, look at Winnie from Up and Away to find the bunnie thing and do this for the spiders in your mod main local function eekaspider(inst) if ThePlayer.prefab == "charactername" then inst:AddComponent("sanityaura") inst.components.sanityaura.aura = (TUNING.SANITYAURA_SMALL * amount) else endend AddPrefabPostInit('spider', eekaspider) I was getting around to finally testing my character and I keep getting this error when I go near spiders now can you help me out? sorry for asking so many questions Link to comment Share on other sites More sharing options...
Dryicefox Posted December 19, 2014 Share Posted December 19, 2014 I was getting around to finally testing my character and I keep getting this error when I go near spiders now can you help me out? sorry for asking so many questions get rid of .prefab and you should be fine Link to comment Share on other sites More sharing options...
KashiKakes Posted December 19, 2014 Author Share Posted December 19, 2014 hey that fixed it thanks! also you wouldn't happen to know how to make it so that I won't lose sanity when using the wormhole do you? Link to comment Share on other sites More sharing options...
KashiKakes Posted December 21, 2014 Author Share Posted December 21, 2014 No one knows how to make wormholes not damage your sanity or to make rabbits not run away? Link to comment Share on other sites More sharing options...
Kzisor Posted January 2, 2015 Share Posted January 2, 2015 hey that fixed it thanks! also you wouldn't happen to know how to make it so that I won't lose sanity when using the wormhole do you? Wormhole just needs some lines of code removed.local function wormhole(inst)local function OnActivate(inst, doer)--print("OnActivated!")if doer:HasTag("player") then ProfileStatsSet("wormhole_used", true)doer.components.health:SetInvincible(true)doer.components.playercontroller:Enable(false) if inst.components.teleporter.targetTeleporter ~= nil thenDeleteCloseEntsWithTag(inst.components.teleporter.targetTeleporter, "WORM_DANGER", 15)end GetPlayer().HUD:Hide()TheFrontEnd:SetFadeLevel(1)doer:DoTaskInTime(4, function() TheFrontEnd:Fade(true,2)GetPlayer().HUD:Show()doer.sg:GoToState("wakeup")end)doer:DoTaskInTime(5, function()doer:PushEvent("wormholespit")doer.components.health:SetInvincible(false)doer.components.playercontroller:Enable(true)end)--doer.SoundEmitter:PlaySound("dontstarve/common/teleportworm/travel", "wormhole_travel")elseif doer.SoundEmitter theninst.SoundEmitter:PlaySound("dontstarve/common/teleportworm/swallow", "wormhole_swallow")endend inst.components.teleporter.onActivate = OnActivatereturn instend AddPrefabPostInit("wormhole", wormhole)As far as the rabbit goes, you need to remove the RunAway lines from their brain. function RabbitBrain:OnStart() local clock = GetClock() local root = PriorityNode( { WhileNode( function() return self.inst.components.health.takingfiredamage end, "OnFire", Panic(self.inst)), RunAway(self.inst, "scarytoprey", AVOID_PLAYER_DIST, AVOID_PLAYER_STOP), RunAway(self.inst, "scarytoprey", SEE_PLAYER_DIST, STOP_RUN_DIST, nil, true), EventNode(self.inst, "gohome", DoAction(self.inst, GoHomeAction, "go home", true )), WhileNode(function() return clock and not clock:IsDay() end, "IsNight", DoAction(self.inst, GoHomeAction, "go home", true )), DoAction(self.inst, EatFoodAction), Wander(self.inst, function() return self.inst.components.knownlocations:GetLocation("home") end, MAX_WANDER_DIST) }, .25) self.bt = BT(self.inst, root)end Link to comment Share on other sites More sharing options...
KashiKakes Posted January 28, 2015 Author Share Posted January 28, 2015 Wormhole just needs some lines of code removed.local function wormhole(inst)local function OnActivate(inst, doer)--print("OnActivated!")if doer:HasTag("player") then ProfileStatsSet("wormhole_used", true)doer.components.health:SetInvincible(true)doer.components.playercontroller:Enable(false) if inst.components.teleporter.targetTeleporter ~= nil thenDeleteCloseEntsWithTag(inst.components.teleporter.targetTeleporter, "WORM_DANGER", 15)end GetPlayer().HUD:Hide()TheFrontEnd:SetFadeLevel(1)doer:DoTaskInTime(4, function() TheFrontEnd:Fade(true,2)GetPlayer().HUD:Show()doer.sg:GoToState("wakeup")end)doer:DoTaskInTime(5, function()doer:PushEvent("wormholespit")doer.components.health:SetInvincible(false)doer.components.playercontroller:Enable(true)end)--doer.SoundEmitter:PlaySound("dontstarve/common/teleportworm/travel", "wormhole_travel")elseif doer.SoundEmitter theninst.SoundEmitter:PlaySound("dontstarve/common/teleportworm/swallow", "wormhole_swallow")endend inst.components.teleporter.onActivate = OnActivatereturn instend AddPrefabPostInit("wormhole", wormhole)As far as the rabbit goes, you need to remove the RunAway lines from their brain.function RabbitBrain:OnStart() local clock = GetClock() local root = PriorityNode( { WhileNode( function() return self.inst.components.health.takingfiredamage end, "OnFire", Panic(self.inst)), RunAway(self.inst, "scarytoprey", AVOID_PLAYER_DIST, AVOID_PLAYER_STOP), RunAway(self.inst, "scarytoprey", SEE_PLAYER_DIST, STOP_RUN_DIST, nil, true), EventNode(self.inst, "gohome", DoAction(self.inst, GoHomeAction, "go home", true )), WhileNode(function() return clock and not clock:IsDay() end, "IsNight", DoAction(self.inst, GoHomeAction, "go home", true )), DoAction(self.inst, EatFoodAction), Wander(self.inst, function() return self.inst.components.knownlocations:GetLocation("home") end, MAX_WANDER_DIST) }, .25) self.bt = BT(self.inst, root)endgah! I got really busy and forgot I had made this thread till just now! thank you so much for all this code help man! Link to comment Share on other sites More sharing options...
KashiKakes Posted January 28, 2015 Author Share Posted January 28, 2015 ok now I'm running into a weird new error after putting in that wormhole code EVERYONE stopped losing sanity when using the wormholes, also it stopped the fade to black before you jump out, the animation for jumping out, and the phrase the character says when hopping out. also I did make sure to change if doer:HasTag("player") then to my character's name any idea what's wrong? Link to comment Share on other sites More sharing options...
Kzisor Posted January 28, 2015 Share Posted January 28, 2015 ok now I'm running into a weird new error after putting in that wormhole code EVERYONE stopped losing sanity when using the wormholes, also it stopped the fade to black before you jump out, the animation for jumping out, and the phrase the character says when hopping out. also I did make sure to change if doer:HasTag("player") then to my character's name any idea what's wrong? Yeah you changed the section of code that actually make it function correctly for other players. Change it back to doer:HasTag("player"). Link to comment Share on other sites More sharing options...
KashiKakes Posted January 28, 2015 Author Share Posted January 28, 2015 ah my bad : x Link to comment Share on other sites More sharing options...
KashiKakes Posted January 28, 2015 Author Share Posted January 28, 2015 now I get an error when I jump in the wormholes ;~; I feel like I've made a big error here, where exactly should I put that wormhole code you gave me? I put it in the modmain for the character Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.
Please be aware that the content of this thread may be outdated and no longer applicable.