Jump to content

Recommended Posts

Hi everyone i'm reasonably new to modding and I would like to make Spider type monsters ignore Chester. However i'm having some trouble finding exactly where spider type monsters determine if a target is attackable or not so after manually searching the .lua files for a few hours I thought maybe I could just ask a more enlightened individual.. xD

 

Thanks anyone who can help out, I greatly appreciate it.

 

(Reasons for this: I play as webber quite often lately and find it annoying to have spiders as pets when they are so aggressive toward my beloved chester)

Link to comment
https://forums.kleientertainment.com/forums/topic/34605-requesting-mod-assistance/
Share on other sites

The most important function is this in spider.lua, you could add an excemption to inst.prefab=="chester" (edit: sorry, that's guy.prefab) where appropriate

local function NormalRetarget(inst)    local targetDist = TUNING.SPIDER_TARGET_DIST    if inst.components.knownlocations:GetLocation("investigate") then        targetDist = TUNING.SPIDER_INVESTIGATETARGET_DIST    end    return FindEntity(inst, targetDist,         function(guy)             if inst.components.combat:CanTarget(guy)               and not (inst.components.follower and inst.components.follower.leader == guy) then                return guy:HasTag("character")            end    end)end
Edited by Heavenfall

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