Jump to content

Recommended Posts

So I'm trying to make a SW mod character who has a trait similar to Webber, but with snakes. Snakes would be neutral towards the character and could be befriended with meat. But looking through Webber's prefab, I can't find what it is that makes spiders neutral towards him. I thought it would be the "monster" or "spiderwhisperer" tags but I found nothing in the game's files that implies they're used for that. I even gave the tags to my character and spawned some spiders to test it but the spiders still attacked unprovoked. I see all of Webber's other traits in the prefab file (walking on webs, eating monster meat, spider egg recipe, and silk beard) but nothing seems to point towards making spiders neutral. Am I missing something about the tags or is the code for what I'm looking for just elsewhere?

 

(Also I'm sorry if maybe this belongs in Kleislist instead? I'm not sure what this counts as since I was just asking that one question and I haven't been here in so long I didn't even realize that forum was a thing until after I posted this)

Edited by MaiTerra

From Spider's Retarget function:

return FindEntity(inst, targetDist, 
        function(guy) 
            if inst.components.combat:CanTarget(guy)
               and not (inst.components.follower and inst.components.follower.leader == guy)
               and not (inst.components.follower and inst.components.follower.leader == GetPlayer() and guy:HasTag("companion")) then
                return (guy:HasTag("character") and not guy:HasTag("monster"))
            end
    end)

Spider checks if nearby targets is tagged as "character" but cancels targetting if target is also tagged as "monster".

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...