Jump to content

[Request] Attempting to create character that is friendly with nightmares.


Nyogtha

Recommended Posts

Hi, I apologize for being so brief, but I am wondering if someone has some advice or code to make a character "friendly" with nightmares, or for that matter, any monstrous group.

 

Any assistance would be greatly appreciated.

 

Thank you.

Link to comment
Share on other sites

You can put a prefabPostInit into your modmain, and change the retargeting function...

 

local function retargetfn(inst) --from shadowcreatures.lua
    local entity = FindEntity(inst, TUNING.SHADOWCREATURE_TARGET_DIST, function(guy)
        return
[REPLACE some conditions that match what you want] and inst.components.combat:CanTarget(guy) --replace
    end)
    return entity
end

 

local function ShadowTargetOverride(inst)

   inst.components.combat:SetRetargetFunction(3, retargetfn)

end

 

AddPrefabPostInit("crawlinghorror",ShadowTargetOverride)

AddPrefabPostInit("terrorbeak",ShadowTargetOverride)

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

Please be aware that the content of this thread may be outdated and no longer applicable.

×
  • Create New...