BHL Posted December 24, 2021 Share Posted December 24, 2021 Basically I'm working on a bee character and am trying to implent a system for sanity gain that is bee related but don't know where to start for sanity aura stuff. Link to comment https://forums.kleientertainment.com/forums/topic/136478-how-to-make-modded-character-gain-sanity-aura-from-beehives-and-flowers/ Share on other sites More sharing options...
Leonidas IV Posted December 24, 2021 Share Posted December 24, 2021 Look at Willow's Prefab, she gains sanity from being near fire, so it's very similar. Link to comment https://forums.kleientertainment.com/forums/topic/136478-how-to-make-modded-character-gain-sanity-aura-from-beehives-and-flowers/#findComment-1527906 Share on other sites More sharing options...
BHL Posted December 24, 2021 Author Share Posted December 24, 2021 (edited) this it? local FLOWER_TAGS = { "flower" } local function sanityfn(inst)--, dt) local delta = inst.components.temperature:IsFreezing() and -TUNING.SANITYAURA_LARGE or 0 local x, y, z = inst.Transform:GetWorldPosition() local max_rad = 10 local ents = TheSim:FindEntities(x, y, z, max_rad, FLOWER_TAGS) for i, v in ipairs(ents) do if v.components.burnable ~= nil and v.components.burnable:IsBurning() then local rad = v.components.burnable:GetLargestLightRadius() or 1 local sz = TUNING.SANITYAURA_TINY * math.min(max_rad, rad) / max_rad local distsq = inst:GetDistanceSqToInst(v) - 9 -- shift the value so that a distance of 3 is the minimum delta = delta + sz / math.max(1, distsq) end end return delta end Edited December 24, 2021 by BHL Link to comment https://forums.kleientertainment.com/forums/topic/136478-how-to-make-modded-character-gain-sanity-aura-from-beehives-and-flowers/#findComment-1527912 Share on other sites More sharing options...
Leonidas IV Posted December 24, 2021 Share Posted December 24, 2021 (edited) This is very specific to willow and its mechanics with fire... You have to change a lot there and then implement that in character. This willow function should be noted, but you need to understand what each part does. I think you can look at Walter's tree sanity gain, it's probably going to be closer to flowers than fire Edited December 24, 2021 by Leonidas IV Link to comment https://forums.kleientertainment.com/forums/topic/136478-how-to-make-modded-character-gain-sanity-aura-from-beehives-and-flowers/#findComment-1527938 Share on other sites More sharing options...
BHL Posted December 24, 2021 Author Share Posted December 24, 2021 k thanks Link to comment https://forums.kleientertainment.com/forums/topic/136478-how-to-make-modded-character-gain-sanity-aura-from-beehives-and-flowers/#findComment-1527984 Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now