Jump to content

How Do I Disable Sanity Loss From Spiders on my Character Mod?


Recommended Posts

Hey, I've been working on a spider character for Don't Starve and just recently I remembered that spiders drain sanity when standing near them. Knowing that my spider character being uncomfortable from another spider didn't make sense I attempted to remedy the situation. However I couldn't find anyone asking on the Internet nor did I find anything obvious in either the Webber.lua and Spider.lua. If anyone knows how to fix this, it would be very much appreciated if you told me here.

 

Thanks~

Link to comment
Share on other sites

For spider characters they usually have the lines of code in their character lua:

inst:AddTag("spiderwhisperer")

inst:AddTag("monster")

The spiderwhisperer tag removes the sanity drain from spiders but requires the monster tag to be neutral to them. Theres also another problem with using the outdated dont starve code, the code only allows webber to friend spiders so if u want to friend spiders u either edit the spider lua and risk incompatability with shipedwrecked by adding ur characters prefab name with webber or figure out how to use the spider hat's ability with ur character.

Link to comment
Share on other sites

23 hours ago, K1NGT1GER609 said:

For spider characters they usually have the lines of code in their character lua:

inst:AddTag("spiderwhisperer")

inst:AddTag("monster")

The spiderwhisperer tag removes the sanity drain from spiders but requires the monster tag to be neutral to them. Theres also another problem with using the outdated dont starve code, the code only allows webber to friend spiders so if u want to friend spiders u either edit the spider lua and risk incompatability with shipedwrecked by adding ur characters prefab name with webber or figure out how to use the spider hat's ability with ur character.

How do I do what you just suggested, aslo I have the same code in my DST mod of the same character and he has no sanity draining effect from spiders so what's different in that game than makes me unable to do the same in the single player games?

Link to comment
Share on other sites

The difference in a nutshell is that don't starve code is outdated compared to don't starve together, so you'll have to manually input everything that webber's perks do. What makes it so that you can't do the same in don't starve together is just a guess: I don't think they expect people to mod a new webber since looking at the code I didn't think they finish making spiderwhisperer into a proper class(I don't want to explain classes if you don't mind). I mean at line 28 of the spider lua code it pretty much makes it so only webber can friend spiders and anyone else who isn't webber can't make friends with spiders regardless of having the tags. So from there option one is  to put next to the code and include that file in your mod and such:

or giver.prefab ~= "youcharacterprefab"

The problem with this option is that it will most likely make your mod crash in shipwrecked. On my monolith character I programmed a item like a unbreakable spider hat to get around it and make it compatible with shipwrecked (check the monolithbadge file). If you decide to do this item I'd recommend downloading the sample mods-sampleprefabs:

 

Note: Before I forget put these lines of codes in you character's main function:

inst.components.locomotor.triggerscreep = false -----pretty much means don't get slowed down in the spider's web and disturb the nest

local nest_recipe = Recipe("spidereggsack", {Ingredient("silk", 12), Ingredient("spidergland", 6), Ingredient("papyrus", 6)}, RECIPETABS.TOWN, TECH.NONE)
    nest_recipe.sortkey = 1
    STRINGS.RECIPE_DESC.SPIDEREGGSACK = "Get a little help from your friends." ----this line of code means you can craft spider eggs

inst.components.eater.monsterimmune = true ----eat monster meat with no penalty

and in your prefabs(I don't remember if it's important but it doesn't hurt to put it):

local prefabs = {
"webber",
}

 

monolithbadge.lua

Link to comment
Share on other sites

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.

×
  • Create New...