Jump to content

Recommended Posts

So I'm making a character mod in which the character generates sanity around certain objects and loses sanity around other certain objects. I've tried modifying others' scripts such as:

local function MakeGood(inst)     if inst and inst.components then            if not inst.components.sanityaura then inst:AddComponent("sanityaura") end            inst.components.sanityaura.aura = GLOBAL.TUNING.SANITYAURA_MED     endend AddPrefabPostInit("flower_evil", MakeGood)--AddPrefabPostInit("someotherprefab", MakeGood)-- add more prefabs here

function AddSanityAura(inst)	inst:AddComponent("sanityaura")    inst.components.sanityaura.aura = TUNING.SANITYAURA_SMALL end
-- AddPrefabPostInit("researchlab", AddSanityAura)-- AddPrefabPostInit("researchlab2", AddSanityAura)-- AddPrefabPostInit("researchlab3", AddSanityAura)

However, none of these appear to be working when I insert my own prefabs to have auras, . How would I go about this? If it helps, the objects I want to have a positive sanity aura are:

-golden boulder

-Marble pillars

-golden rock piles (shipwrecked)

And I would like these to have a negative sanity aura:

-beefalo/ water beefalo (shipwrecked)

-pigs/ wildbores (shipwrecked)

-splumonkeys/ prime apes (shipwrecked)

Thanks!

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...