Jump to content

Search the Community

Showing results for tags 'sanity'.

  • Search By Tags

    Type tags separated by commas.
  • Search By Author

Content Type


Forums

  • Oxygen Not Included
    • Oxygen Not Included FAQ
    • [Oxygen Not Included] - Developer log
    • [Oxygen Not Included] - General Discussion
    • [Oxygen Not Included] - Bug Tracker
    • [Oxygen Not Included: Spaced Out!] - Bug Tracker
    • [Oxygen Not Included] - Mods and Tools
    • [Oxygen Not Included] - Suggestions and Feedback
    • [Oxygen Not Included] Art, Music & Lore
    • Community Challenges
    • [Oxygen Not Included] - Latest Content Update
    • [Oxygen Not Included] - Latest Animated Short
    • Oxygen Not Included DLC Alpha
  • Don't Starve Together
    • Don't Starve Together FAQ
    • [Don't Starve Together] Developer log
    • [Don't Starve Together] General Discussion
    • [Don't Starve Together] Beta Branch
    • [Don't Starve Together] PlayStation
    • [Don't Starve Together] Xbox One
    • [Don't Starve Together] Nintendo Switch
    • [Don't Starve Together] Bug Tracker
    • [Don't Starve Together] Trading
    • [Don't Starve Together] Server Bulletin
    • [Don't Starve Together] Dedicated Server Discussion
    • [Don't Starve Together] Mods and Tools
    • [Don't Starve Together] Tales of Life and Death
    • [DS + DST] Art, Music and Lore
    • [Don't Starve Together] Suggestions and Feedback
    • [Don't Starve Together] The Forge
    • [Don't Starve Together] The Gorge
    • [Archived Bugs]
  • Don't Starve
    • Don't Starve FAQ
    • [Don't Starve: Pocket Edition] iOS / Android
    • [Don't Starve] General Discussion
    • [Don't Starve] Mods and tools
    • [Don't Starve] Art, Music & Lore
    • [Don't Starve] Suggestions and Feedback
    • [Don't Starve] Videos
    • [Don't Starve] Bug Tracker
    • [Don't Starve] Trading
    • [Don't Starve] Testing Discussion (archive)
  • Griftlands
    • [Griftlands] - General Discussion
    • [Griftlands] - Suggestions and Feedback
    • [Griftlands] - Mods and Tools
    • [Griftlands] - Localization
    • [Griftlands] - Bug Tracker
    • [Griftlands] - Developer log
  • Hot Lava
    • [Hot Lava] - General Discussion
    • [Hot Lava] - Suggestions and Feedback
    • [Hot Lava] - Bug Tracker
    • [Hot Lava] - Strats and Records
    • [Hot Lava] - Developer Log
    • Hot Lava Latest Update
  • Klei Entertainment Games
    • Eets Munchies
    • [Invisible, Inc.] General Discussion and Strategies
    • Mark of the Ninja
    • Shank
  • Other Stuff
    • Other Klei Services

Categories

  • Don't Starve
    • Custom Characters
    • Game Modifications
    • Language Packs
    • Modding Tools, Tutorials & Examples
    • Custom Maps

Categories

  • Oxygen Not Included
  • Oxygen Not Included: Spaced Out!
  • Griftlands
  • Don't Starve
  • Don't Starve Together
  • Don't Starve Together: Beta Branch
  • [Don't Starve Together] Nintendo Switch
  • [Don't Starve Together] PlayStation
  • Don't Starve Together: Return of Them
  • Don't Starve Together: The Gorge
  • Don't Starve Together: The Forge
  • Don't Starve Together: The Forge (Archive)
  • [Don't Starve Together] Xbox One
  • Don't Starve: Shipwrecked [archive]
  • [Don't Starve Together] PS4 (archive)
  • [iOS] Don't Starve: Shipwrecked
  • Don't Starve: Hamlet [ARCHIVE]
  • Don't Starve: Shipwrecked [ARCHIVE]
  • Don't Starve: Hamlet Early Access [archive]
  • Don't Starve: Hamlet Closed Beta (ARCHIVE)

Categories

  • Oxygen Not Included
  • Oxygen Not Included: Spaced Out!
  • Griftlands
  • Hot Lava
  • Don't Starve Together
  • [Nintendo Switch] Don't Starve Together
  • [PlayStation] Don't Starve Together
  • [Xbox One] Don't Starve Together
  • Don't Starve
  • Don't Starve: Shipwrecked

Find results in...

Find results that contain...


Date Created

  • Start

    End


Last Updated

  • Start

    End


Filter by number of...

Joined

  • Start

    End


Group


Biography


Location


Interests


Occupation


Favorite Game


Modder


Chester Kickstarter


Chester Kickstarter


Chester Kickstarter


Chester Kickstarter


Chester Kickstarter


Klei Featured Artist


Early Supporter


Early Supporter


Don't Starve


Don't Starve Together


Oxygen Not Included

  1. How do i make my character lose sanity whenever they kill a mob? Also, is there a way to make the character slower and weaker when insane?
  2. Hey, so... I need help with a character who should gain some sanity when he plants seeds. Previously I used this code in modmain, but it seems that after the Reap What You Sow update, it stopped working for seeds because of the new farm system. The rest like bushes and pinecones still work. But it doesn't work when planting seeds in farm soils. I have already searched in many places and even in the wormwood codes and nothing has worked for me Some help please. local function SanityOnDeploy(inst) if inst.components.deployable then local oldondeploy = inst.components.deployable.ondeploy inst.components.deployable.ondeploy = function(inst, pt, deployer) if oldondeploy then oldondeploy(inst, pt, deployer) end if deployer.prefab == "rossa" then deployer.components.sanity:DoDelta(3) end end end end AddPrefabPostInit("pinecone", SanityOnDeploy) AddPrefabPostInit("twiggy_nut", SanityOnDeploy) AddPrefabPostInit("acorn", SanityOnDeploy) AddPrefabPostInit("dug_grass", SanityOnDeploy) AddPrefabPostInit("dug_sapling", SanityOnDeploy) AddPrefabPostInit("dug_berrybush", SanityOnDeploy) AddPrefabPostInit("dug_berrybush2", SanityOnDeploy) AddPrefabPostInit("butterfly", SanityOnDeploy) AddPrefabPostInit("berrybush_juicy", SanityOnDeploy) AddPrefabPostInit("marsh_bush", SanityOnDeploy) AddPrefabPostInit("dug_rock_avocado_bush", SanityOnDeploy) AddPrefabPostInit("dug_sapling_moon", SanityOnDeploy) AddPrefabPostInit("seeds", SanityOnDeploy) AddPrefabPostInit("asparagus_seeds", SanityOnDeploy) AddPrefabPostInit("carrot_seeds", SanityOnDeploy) AddPrefabPostInit("corn_seeds", SanityOnDeploy) AddPrefabPostInit("dragonfruit_seeds", SanityOnDeploy) AddPrefabPostInit("durian_seeds", SanityOnDeploy) AddPrefabPostInit("eggplant_seeds", SanityOnDeploy) AddPrefabPostInit("garlic_seeds", SanityOnDeploy) AddPrefabPostInit("onion_seeds", SanityOnDeploy) AddPrefabPostInit("pepper_seeds", SanityOnDeploy) AddPrefabPostInit("pomegranate_seeds", SanityOnDeploy) AddPrefabPostInit("potato_seeds", SanityOnDeploy) AddPrefabPostInit("pumpkin_seeds", SanityOnDeploy) AddPrefabPostInit("tomato_seeds", SanityOnDeploy) AddPrefabPostInit("watermelon_seeds", SanityOnDeploy)
  3. I would like to make it Warly get a small amount of sanity, and maybe says some random quote every time he starts cooking in his portable crockpot. I have no idea how to do this, so I haven't tried anything. How would I go about doing this?
  4. So, I'm trying to make my character afraid of Pickaxes. Being that he himself is made of rock. I've found a thread that point's me in the right direction. But I'm wondering how do I check other player's inventories for Them holding a pick, and how do I check the ground for random dropped pickaxes, either from corpses or people not using chests. Thanks in advance
  5. Hi! I'm making my first mod because i wanted to add a character i made in the game, i'm not really good at coding so i was wondering if someone could help me with a perk! Basically what i want my character to do is to give a sanity aura (Like a gloomer) to other players around, with a maximum of 2 players near my character (If there's 1 person near he will still give sanity aura) But when there are 3 or more players near my character, he will give an insanity aura instead I know that is it possible to make a character give sanity aura, but i'm not so sure if something this specific can be made Many thanks for the help!
  6. Hey! I'm trying to give a character an "extrovert" perk. Giving them sanity gain when around other players. I can't get it to work however. I'm pretty new to modding so I might be doing something wrong. I added the code at the bottom (before the last end) in the character.lua file. I used this code. This is for DST btw. local function sanityfn(inst) local x,y,z = inst.Transform:GetWorldPosition() local delta = 0 local rad = 10 local rad_sq = rad*rad for k,v in pairs(AllPlayers) do if v ~= inst then local distsq = inst:GetDistanceSqToInst(v) if distsq < rad_sq then local sz = TUNING.SANITYAURA_MED * rad delta = delta + sz/math.max(1, distsq) end end end return delta end inst.components.sanity.custom_rate_fn = sanityfn
  7. I'm at a complete loss for how to achieve this one. Without tying the trait to an item, I want the character I'm currently working on to teleport randomly once their sanity drops super low. I've been futzing around with the telelocator staff's code, but I don't know how to apply the action directly onto a character... Is this even possible, and if it is does anyone know what the best way to go about this might be? Thanks in advance.
  8. I have some working DS code for sanity effects in my custom character's modmain, but I don't know how to change it for DST
  9. Hey! So I'm making a mod and I want to know how to make a custom item that restores sanity when held and can only be crafted by a custom character. Thanks!
  10. As the title says, i want to create a perk that focuses on sanity during combat, it goes like this - This character has 250 sanity (Already coded). Whenever this character is attacked, this character loses 10 sanity points, This effect also applies to everyone else in the server, but everyone else loses 3 sanity points instead. When this character dies, everyone loses 90 sanity points. When this character is revived, their sanity score will start at 20. Can someone help or at least hint me through on how i'm able to do this? I would be very grateful!
  11. Hey, I wanted my character to lose sanity near fire and gain sanity near animals. I added two functions for both of the but only the one ( specifically the gain sanity one) works. I tried to add both in one function but since I'm still learning how to work with scripts (blame my teachers and my laziness) I made a mess and none of them worked. I believe that it's the "inst.components.sanity.custom_rate_fn = " command that I used twice that cause's the problem. Any ideas or help I could use both. alice.lua
  12. Hey'a how's it goin'? I was wondering if anyone could help me with a custom perk i would like added to my Custom Character for DST. I would like to be able to have it so i don't lose sanity while going thru a wormhole. It's only a minor thing i know but I'd thought it'd be a nice little perk. Thanks!
  13. I am working on a mod for a character, but I need help. I need to have the character lose sanity around ponds, but I do not know all the coding to do it. I know parts of what it would need, but I do not know the exact coding to have them lose sanity around a certain object. If anyone knows the coding needed on how to do this, I would really appreciate it! Thank you so much!
  14. Hey guys, I have a problem, my character can causa a meteor shower if his sanity gets too low, and he resets this meteor shower as his sanity drops, this is the code under the: local master_postinit = function(inst) inst:AddComponent("meteorshower") if inst.components.meteorshower.task then --it automatically scheduled a shower inst.components.meteorshower:StopShower() --remove the automatically-scheduled shower end --override the StartCooldown on this particular component instance so it does not schedule more showers after completing one inst.components.meteorshower.StartCooldown = inst.components.meteorshower.StopShower --Watch sanity to know when to trigger the showers inst:ListenForEvent("sanitydelta", function(inst, data) --data provides the oldpercent and newpercent for sanity, so it is easier to do thresholds in percents --... but you could convert like this local oldsanity = data.oldpercent * inst.components.sanity.max local newsanity = data.newpercent * inst.components.sanity.max local level = nil if newsanity <= 0 and oldsanity > 0 or newsanity <= 10 and oldsanity > 10 then level = 3 elseif newsanity <= 20 and oldsanity > 20 then level = 3 elseif newsanity <= 30 and oldsanity > 30 then level = 3 elseif newsanity <= 40 and oldsanity > 40 then level = 3 end if level then --we passed a threshold and need to spawn a shower inst.components.meteorshower:StartShower(level) end end) with this code if his sanity drops from 41 to 40, a meteor shower will happen, but if the sanity rises from 39 to 40, nothing happens. okay, but the biggest problem here is that this works inside caves, it makes no sense at all. I wanted to do something like this: if the character is in the surface, he will cause a meteor shower if his sanity gets too low. But, if the character is inside a cave/ruins, he will cause an earthquake inside the cave/ruins in the same level that he would cause the meteor shower if he were in the surface, of course if his sanity gets too low. it's possible to do something like that?
  15. so, I have a character who is arachnophobic, he loses a lot of sanity near spiders, I'm using this function for this to work: local function sanityfn(inst) local x,y,z = inst.Transform:GetWorldPosition() local delta = 0 local max_rad = 20 local ent = FindEntity(inst, 100, function(ent) return ent:HasTag("spider") and not(ent.components.health and ent.components.health:IsDead()) end) local ent = FindEntity(inst, 100, function(ent) return ent:HasTag("spider_warrior") and not(ent.components.health and ent.components.health:IsDead()) end) local ent = FindEntity(inst, 100, function(ent) return ent:HasTag("spiderden") and not(ent.components.health and ent.components.health:IsDead()) end) if ent then local sz = -TUNING.SANITYAURA_LARGE*3 local rad = 20 sz = sz * ( math.min(max_rad, rad) / max_rad ) local distsq = inst:GetDistanceSqToInst(ent) delta = delta + sz/math.max(1, distsq) end return delta end and the sanity funcion: local master_postinit = function(inst) -- Custom sanity function inst.components.sanity.custom_rate_fn = sanityfn end so, I thought: "Webber is a huge spider monster, it would make sense to lose sanity next to him if another player is using him next to my character", so I tried the same code: local ent = FindEntity(inst, 100, function(ent) return ent:HasTag("webber") and not(ent.components.health and ent.components.health:IsDead()) end) but no luck at all, it's possible to do that? make my character lose sanity to another player who is using Webber?
  16. Hello! I've ditched my previous two ideas in favor of something a little more manageable. Basically, I want to make my character gain sanity based on the phase of the moon, with the highest being during a full moon and the lowest being during a new moon. The code I currently have looks like this: local function Clock:GetMoonPhase() if --(whatever i would put for it being nighttime) if isfullmoon then --[insert dapperness thingy here] etc, etc. Is what I have right now on the right track? And how would I reset the dapperness value after night, so that she isn't constantly gaining sanity while the sun"s out? Also, is it possible to make it like a sliding scale between the maximum and minimum sanity gain (basically it's like a smooth transition b/w full and new?? idk if i'm explaining this well enough) Thanks for any help!
  17. I'm attempting to make an item for my character where in it can detect my characters sanity, in such that if the sanity of the character is above 50%, it will give a small amount of sanity (similar to the garland and parasol), but if the character's sanity is below 50%, then it will reduce a small amount of sanity (similar to the sanity loss at night) so far I've tried: local function sanitycheck(inst) if owner.sanity = >= 50 then inst.components.equippable.dapperness = TUNING.DAPPERNESS_SMALL else inst.components.equippable.dapperness = TUNING.CRAZINESS_MED end end and putting it under local function Onequip: local function OnEquip(inst, owner) owner.AnimState:OverrideSymbol("swap_object", "swap_ella", "swap_ella") owner.AnimState:Show("ARM_carry") owner.AnimState:Hide("ARM_normal") if owner.sanity = >= 50 then inst.components.equippable.dapperness = TUNING.DAPPERNESS_SMALL else inst.components.equippable.dapperness = TUNING.CRAZINESS_MED end end but neither works. Could anyone give some advice on how to fix this please? Thank you
  18. Hi! I've been trying to make my character mod gain sanity when using the sewing kit (or gaining sanity when holding it, at the very least). I have succeeded to make my character gain sanity upon catching fireflies, but this code does not seem to work for the sewing kit. inst:ListenForEvent( "finishedwork", function(inst, data) if(data and data.target and data.target.prefab=="dress") then if(data.action and data.action.id=="SEW") then if(inst and inst.components and inst.components.sanity) then inst.components.sanity:DoDelta(20) -- amount of sanity gain here inst.components.talker:Say("It feels nice to sew after a while...") end end end end ) I tried countless times to make this work with a bunch of references from other codes, but I can't seem to make it work as easy as it seems! I think it's the 'prefab' target that is set wrong, as I want all clothing to be affected, not a specific one. Does anyone have an idea how this works?
  19. Hello there! So i was trying to create a character wich would lose sanity when it would be raining,tried to code it myself and looked here and there but nothing seems to work. I looked up how WX-78 loses his health during rain and tried to modify the code but it seems to not work at all So if anybody could help me i would appreciate it a lot!
  20. I'm trying to make it so that my character gains more sanity from wearing garlands specifically. I had found code for sanity bonus from picking things (in my case, flowers), and I'm hoping I can apply it to increasing the sanity gain from wearing a garland. Does anyone know what the hat worn event is called? EDIT: Would the code for altering the sainty gained from wearing a garland look like this? inst:ListenForEvent( "puteventhere" function(inst, data) if(data and data.object and data.object.prefab=="flowerhat") then if(inst and inst.components and inst.components.sanity) then inst.components.sanity:DoDelta(put sanity change here) end end end )
  21. Hello! I'm pretty new to modding, and was wondering if it's possible to make items uncraftable when sanity is below a certain threshold? Later I would like to translate that to "dark energy" which is a custom meter that I made for my character. The code I've been fiddling around with: inst:DoPeriodicTask(5, function() local old = inst.replica.builder.CanLearn local de = inst.components.darkenergy:GetPercent() function inst.replica.builder:CanLearn(recname) if forbidden1 [recname] and de < .40 then return false elseif forbidden2 [recname] and de < .30 then return false elseif forbidden3 [recname] and de >=.40 then return old(self,recname) else return old(self,recname) end end end) I've gotten it to work where once de (dark energy) gets below 30, the recipes disappear, but I have issues with the recipes reappearing once de increases above 40. Any help/tips would be greatly appreciated!! Edit: I think I realized why the recipe won't reappear: they are taken out of the game until restart. Is there a way to lock recipes instead of taking them out completely?
  22. Hello! I was trying to work on a perk for my character that would allow her to gain sanity when she's near other players... However, I can't seem to find a way to distinguish other players from my modded character. Code is in the spoiler: So basically my problem is that she is gaining sanity near others BUT it's also counting herself as an 'other' and that's not what I want. I want her to gain sanity only when she's near someone else rather than it counting herself as a sanity gain.
  23. Hi there folks! I'm working on a character who emits a sanity aura for people around him. Problem is, the aura ALSO affects him. I would like the aura to only affect OTHER people, and not him. Currently the sanity script is very rudimentary, here it is: -- Sanity aura! inst:AddComponent("sanityaura") inst.components.sanityaura.aura = TUNING.SANITYAURA_SMALL Also; How do you get rid of the noise? Whenever his sanity aura is used, it makes the noise of rejuvinating sanity. I would prefer it to be a passive and silent effect, so any help is appreciated! Thanks in advance!
  24. Hi everyone, I have a pretty simple question that I need help with. I wanted to have my DST character have his own custom instrument, but I can find no tutorial to achieve this! the most commonly used tutorial (This one) has files that are missing, and it's for DS not DST. Other than that one, I can find NO tutorial on setting this up, Thanks in advance!
  25. I can't figure out how to make a special sanity regen bonus only for cpecific character?For example, i wear bearger vest and gain +10 sanity/minute. I tried this, but it doesnt seem to work:
×
  • Create New...