Sign in to follow this  
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    42

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.

  • Like 1

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.

Edited by InniePanda

Share this post


Link to post
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

Sign in to follow this