Search the Community
Showing results for tags 'target'.
EDIT2: You need to use TheWorld.ismastersim to check whether serverside in those functions or it will crash when on a server. Didn't figure that out till after I made this post, but it's not really a hard fix. EDIT: Nevermind, I went back after a while of solving other problems and finally figured it out. It turns out that the ghost doesn't "attack", it just has an aura component that damages everything around it (I didn't know what this was at the time). Overriding the follow behavior was a bit harder because the follow function in the brain was a local one which i could not directly override. For the curious, this is what I did: -Don't aggro local function IgnoreYuyu(inst) local follow_node = nil for i,v in ipairs(inst.bt.root.children) do --print(v.name) if v.name == "Follow" then --print("Node found:", v.name) follow_node = v break end end if follow_node then old_target = follow_node.target follow_node.target = function() ent = old_target() if ent and ent:HasTag("yuyuko") then return nil end return ent end end end AddBrainPostInit("ghostbrain", IgnoreYuyu) -Don't harm local function NonSaneGhost(inst) -- Exclude yuyuko (the character) from things that are damaged by the aura table.insert(inst.components.aura.auraexcludetags, "yuyuko") -- Make sanity drain calc return 0 if observer is yuyuko inst.components.sanityaura.aurafn = function(instance, observer) return observer:HasTag("yuyuko") and 0 or inst.components.sanityaura.aura end end AddPrefabPostInit("ghost", NonSaneGhost) ORIGINAL TEXT
So, a few things that I'm trying to take examples from to apply to whatever I'm working on (Bernie and Willow's Lighter), but I cannot find code for. I want to try things for myself before asking any proper code advice, but for me right now, the biggest problem is finding what is where: 1) Where is it mentioned and what function makes it so that the lureplants can't gobble up the chester eyebone? I tested it, and they don't eat it, but I cannot find a reference for any code anywhere really when looking for it; to my knowledge, it's not in eyeplant.lua, eyebone.lua, digester.lua or eater.lua. 2) Where is it mentioned and what function makes it so that the eyebone drops upon the player exiting? 3) Where is it mentioned and what function makes it so that a Woodie player cannot hold onto more than one Lucy the Axe? 4) Where is it mentioned and what function makes it so that you can light things on fire with Willow's Lighter?