ThaumicParrot Posted February 8, 2016 Share Posted February 8, 2016 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! Link to comment https://forums.kleientertainment.com/forums/topic/64038-making-certain-objects-have-a-positive-sanity-aura/ Share on other sites More sharing options...
PanAzej Posted February 8, 2016 Share Posted February 8, 2016 Add this: inst.components.sanityaura:GetAura("yourcharacterprefab") Link to comment https://forums.kleientertainment.com/forums/topic/64038-making-certain-objects-have-a-positive-sanity-aura/#findComment-719686 Share on other sites More sharing options...
ThaumicParrot Posted February 8, 2016 Author Share Posted February 8, 2016 1 minute ago, PanAzej said: Add this: inst.components.sanityaura:GetAura("yourcharacterprefab") Thanks! Does this work with both of the examples? Link to comment https://forums.kleientertainment.com/forums/topic/64038-making-certain-objects-have-a-positive-sanity-aura/#findComment-719687 Share on other sites More sharing options...
PanAzej Posted February 8, 2016 Share Posted February 8, 2016 2 minutes ago, ThaumicParrot said: Thanks! Does this work with both of the examples? It should work, I think. Link to comment https://forums.kleientertainment.com/forums/topic/64038-making-certain-objects-have-a-positive-sanity-aura/#findComment-719688 Share on other sites More sharing options...
ThaumicParrot Posted February 8, 2016 Author Share Posted February 8, 2016 4 minutes ago, PanAzej said: It should work, I think. Yep, just tried it! Thanks again! Link to comment https://forums.kleientertainment.com/forums/topic/64038-making-certain-objects-have-a-positive-sanity-aura/#findComment-719695 Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now