Jump to content

Recommended Posts

Copying my answer from the other post, so people searching for something similar can easily find it.

You should create an aurafn for the hounds, extending any existing aurafn on them. Granted, the hounds do not have an aurafn, but you don't know whether another mod adds one, so for added compatibility we want to make sure to call any existing aurafn in the event that it's not your character. This also works for DST. Add this to your modmain.lua and change the "character tag" text to a tag that is unique to your character.

local entitiesThatShouldGiveCharacterNoSanityAura = {
	"hound",
	"firehound",
	"icehound",
	"moonhound",
	"clayhound",
	"mutatedhound",
}

for i,v in ipairs(entitiesThatShouldGiveCharacterNoSanityAura) do
	AddPrefabPostInit(v, function(inst)
		local origAura = inst.components.sanityaura.aurafn
		local function CalcSanityAura(inst, observer)
			return observer:HasTag("character tag") and 0 or origAura ~= nil and origAura(inst, observer) or inst.components.sanityaura.aura
		end
		
		inst.components.sanityaura.aurafn = CalcSanityAura
	end)
end
9 minutes ago, Veketh said:

Thank you so much... again... and just to confirm, I can make a completely new tag for it right?

Man... you are like a blessing for me. 

You are very welcome. Just happy to help :)

And yes, you can make a new tag. However, you can only have 63 tags on an entity and the game code makes plenty use of them already, so try to use as few custom tags as you can. If you ever run into the problem with having too many tags, you can instead just say inst.myuniquevariable = true in your master_postinit or fn of your prefab, and then check that variable instead of checking for a tag. But I doubt you're hitting that tag limit, so just make a new tag.

Errmm.. "only 63 tags" huh? I wonder if it's that small amount.. but I don't question anything, maybe it is a small amount in big projects, but I am just some stupid kid who wants his own character in-game so yeah... Thanks again for your help.

Well, the limit was 31 at one time and I believe the game applies 23+ tags for a standard character or something, so complex characters, with a lot of tags getting added and removed, would hit this limit.

Edited by Ultroman

In addition to Maris:
Normally this is enough for server only and if this value is always the same. I you want to change the value midgame, you need to add Save/Load for it too, but that is not different from tags.

Maris is "star" on steam: https://steamcommunity.com/id/strelka/myworkshopfiles/?appid=322330

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
×
  • Create New...