Jump to content

Sanity Aura Around Character


Recommended Posts

Ok so I am not even sure this is possible but I am working on a modpack for DST (modpack because I might add other customs things later), but for now I am working on custom characters. These characters are from a DnD game a friend and I played where we decided they were best friends. We are even currently working on an animated series that is based around them. So to the point. What I am trying to do is set it so when both characters are together they give each other a sanity aura (not a major one just enough to maybe slow down sanity loss when fighting mobs or at night or something). If it isn't possible to set it to activate when they are near each other maybe set it so say (we will use ELF and DWARF because those are their races), elf has a sanity aura, but only dwarf can get it, and dwarf has a sanity aura but only elf can get it. Now I know I just repeated myself twice but maybe saying it a different way might cause someone to figure it out. Now I know I can create characters that have sanity auras but I want these auras to only effect the two of them. I will probably be posting other topics I need help in modding related to our adventures in the animated scripts so if anyone would like to follow along you are welcome.

 

Thanks for any possible help.

Link to comment
Share on other sites

-- ELF

local function master_postinit(inst)

inst:AddComponent("sanityaura")

inst.components.sanityaura.aurafn = function(inst, observer)

if observer.prefab == "dwarf" then

return TUNING.SANITYAURA_TINY

end

return 0

end

end

-- DWARF

local function master_postinit(inst)

inst:AddComponent("sanityaura")

inst.components.sanityaura.aurafn = function(inst, observer)

if observer.prefab == "elf" then

return TUNING.SANITYAURA_TINY

end

return 0

end

end

Link to comment
Share on other sites

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
 Share

×
  • Create New...