Jump to content

How to make a perk to give other players sanity while my character wears garland?


Recommended Posts

Hello everyone!
I create a character for DST and I have a question.So...
I want to know can I give to my character a special aura while he wears garland? This aura should raise up the sanity for my character and for other nearby players.
So.Can I do it?
And...can my character has an aura that makes him glowing in case sanity>80%?

I will be waiting for answers!

Link to comment
Share on other sites

Here's a start:

local function CalcSanityAura(inst)
local equip = inst.components.inventory:GetEquippedItem(EQUIPSLOTS.HEAD)
if (equip ~= nil) and (equip.prefab == "flowerhat") and (inst.components.sanity:GetPercent() > .8) then

--glowing code?
    return TUNING.SANITYAURA_SMALL
  elseif equip ~= nil and equip.prefab == "flowerhat" then
  return TUNING.SANITYAURA_SMALL --you can put tiny,small,med,large but in all caps
end    
end

local master_postinit = function(inst) --just reference where things go more or less

inst:AddComponent("sanityaura")
    inst.components.sanityaura.aurafn = CalcSanityAura

First off this is the don't starve mod forums very different from don't starve together mod forums, next is you should probably explain glowing. Does it mean you emit a light around you? Does it mean your character's actual artwork gets a color tint? I'm not sure how to implement it properly.

Link to comment
Share on other sites

On 09.01.2018 at 2:50 AM, K1NGT1GER609 said:

Here's a start:

local function CalcSanityAura(inst)
local equip = inst.components.inventory:GetEquippedItem(EQUIPSLOTS.HEAD)
if (equip ~= nil) and (equip.prefab == "flowerhat") and (inst.components.sanity:GetPercent() > .8) then

--glowing code?
    return TUNING.SANITYAURA_SMALL
  elseif equip ~= nil and equip.prefab == "flowerhat" then
  return TUNING.SANITYAURA_SMALL --you can put tiny,small,med,large but in all caps
end    
end

local master_postinit = function(inst) --just reference where things go more or less

inst:AddComponent("sanityaura")
    inst.components.sanityaura.aurafn = CalcSanityAura

First off this is the don't starve mod forums very different from don't starve together mod forums, next is you should probably explain glowing. Does it mean you emit a light around you? Does it mean your character's actual artwork gets a color tint? I'm not sure how to implement it properly.

Thank you so much <3
Yes, I mean emit a light around the character.

Link to comment
Share on other sites

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.

×
  • Create New...