Jump to content

Recommended Posts

I thought for sure it was:

local function CalcSanityAura(inst)    return inst.components.combat.target ~= nil and -TUNING.SANITYAURA_LARGE or 0end

and

local function fn()	inst:AddComponent("sanityaura")	inst.components.sanityaura.aurafn = CalcSanityAuraend

Did I just place them incorrectly?

 

How its suppose to work: When people surround my character, they lose sanity faster than usual.

Edited by rons0n
Link to comment
https://forums.kleientertainment.com/forums/topic/50007-sanity-drain-aura/
Share on other sites

@rons0n, that's because CalcSanityAura will only return -TUNING.SANITYAURA_LARGE if your character has a combat target, otherwise, it returns 0. To give off a permanent insanity aura around your character, just do this:

inst:AddComponent("sanityaura")inst.components.sanityaura.aura = -TUNING.SANITYAURA_LARGE

 

@rons0n, that's because CalcSanityAura will only return -TUNING.SANITYAURA_LARGE if your character has a combat target, otherwise, it returns 0. To give off a permanent insanity aura around your character, just do this:

inst:AddComponent("sanityaura")inst.components.sanityaura.aura = -TUNING.SANITYAURA_LARGE

 

Like so?

local MakePlayerCharacter = require "prefabs/player_common"local assets = {        Asset( "ANIM", "anim/player_basic.zip" ),        Asset( "ANIM", "anim/player_idles_shiver.zip" ),        Asset( "ANIM", "anim/player_actions.zip" ),        Asset( "ANIM", "anim/player_actions_axe.zip" ),        Asset( "ANIM", "anim/player_actions_pickaxe.zip" ),        Asset( "ANIM", "anim/player_actions_shovel.zip" ),        Asset( "ANIM", "anim/player_actions_blowdart.zip" ),        Asset( "ANIM", "anim/player_actions_eat.zip" ),        Asset( "ANIM", "anim/player_actions_item.zip" ),        Asset( "ANIM", "anim/player_actions_uniqueitem.zip" ),        Asset( "ANIM", "anim/player_actions_bugnet.zip" ),        Asset( "ANIM", "anim/player_actions_fishing.zip" ),        Asset( "ANIM", "anim/player_actions_boomerang.zip" ),        Asset( "ANIM", "anim/player_bush_hat.zip" ),        Asset( "ANIM", "anim/player_attacks.zip" ),        Asset( "ANIM", "anim/player_idles.zip" ),        Asset( "ANIM", "anim/player_rebirth.zip" ),        Asset( "ANIM", "anim/player_jump.zip" ),        Asset( "ANIM", "anim/player_amulet_resurrect.zip" ),        Asset( "ANIM", "anim/player_teleport.zip" ),        Asset( "ANIM", "anim/wilson_fx.zip" ),        Asset( "ANIM", "anim/player_one_man_band.zip" ),        Asset( "ANIM", "anim/shadow_hands.zip" ),        Asset( "SOUND", "sound/sfx.fsb" ),        Asset( "SOUND", "sound/wilson.fsb" ),        Asset( "ANIM", "anim/beard.zip" ),        Asset( "ANIM", "anim/sakura.zip" ),        Asset( "ANIM", "anim/ghost_sakura_build.zip" ),}local prefabs = {	"book_tentacles", "book_tentacles", }local start_inv = {	-- Custom starting items	"book_tentacles" , "book_tentacles", }-- This initializes for both clients and the hostlocal common_postinit = function(inst) 	-- Minimap icon	inst.MiniMapEntity:SetIcon( "sakura.tex" )	inst:AddTag("bookbuilder")endlocal function CalcSanityAura(inst)    return inst.components.combat.target ~= nil and -TUNING.SANITYAURA_LARGE or 0endlocal function fn()	inst:AddComponent("sanityaura")	inst.components.sanityaura.aura = -TUNING.SANITYAURA_LARGEend-- This initializes for the host onlylocal master_postinit = function(inst)	-- choose which sounds this character will play	inst.soundsname = "willow"	-- Stats		inst.components.health:SetMaxHealth(300)	inst.components.hunger:SetMax(150)	inst.components.sanity:SetMax(200)	inst.components.sanity.night_drain_mult = 0	inst.components.sanity.neg_aura_mult = 0	inst.components.locomotor.walkspeed = 4	inst.components.locomotor.runspeed = 5.5	--  Night-vision    inst.entity:AddLight()    inst.Light:Enable(true)    inst.Light:SetRadius(5)    inst.Light:SetFalloff(.6)    inst.Light:SetIntensity(0.9)    inst.Light:SetColour(235/255,12/255,12/255)	inst:ListenForEvent( "nighttime", function() inst.entity:AddLight() end, GetWorld() )endreturn MakePlayerCharacter("sakura", prefabs, assets, common_postinit, master_postinit, start_inv, fn)

If so, my friend still doesn't feel the sanity loss :nightmare:

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
×
  • Create New...