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 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 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 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 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 Share on other sites More sharing options...
Recommended Posts
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.