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.

InniePanda

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

Recommended Posts

InniePanda    0

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!

Share this post


Link to post
Share on other sites
K1NGT1GER609    95

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.

Share this post


Link to post
Share on other sites
InniePanda    0
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.

Share this post


Link to post
Share on other sites
K1NGT1GER609    95

I can't quite make the character spawn light around the character,it's better for you ask in the don't starve together forum. Doubt you'll get much help in this forum.

Share this post


Link to post
Share on other sites