Jump to content

Recommended Posts

I'm currently creating a mod character that can tame shadow creatures (crawling horror and terror break) and I'm having some issues, other creatures do not attack them! even when they  are attacking them.

 

For example, I send a crawling horror to attack a pigman and he doesn't attack him back..

 

Why is this happening? 

pet_CrawlingHorror.lua

pet_TerrorBreak.lua

shadowcreature.lua

Link to comment
https://forums.kleientertainment.com/forums/topic/50078-shadow-creatures-trouble/
Share on other sites

Just for reference, this is a little bit taken from shadowcreature.lua:

inst:AddTag("shadowcreature")inst:AddTag("monster")inst:AddTag("hostile")inst:AddTag("shadow")inst:AddTag("notraptrigger")

and this is from combat_replica.lua:

function Combat:IsValidTarget(target)    return target ~= nil and        target ~= self.inst and        target.entity:IsValid() and        target.entity:IsVisible() and        target.replica.combat ~= nil and        target.replica.health ~= nil and        not target.replica.health:IsDead() and        not (target:HasTag("shadow") and self.inst.replica.sanity == nil) and        not (target:HasTag("playerghost") and (self.inst.replica.sanity == nil or self.inst.replica.sanity:IsSane())) and        (TheNet:GetPVPEnabled() or not (self.inst:HasTag("player") and target:HasTag("player"))) and        target:GetPosition().y <= self._attackrange:value()end

so you can kinda see how the tags are used to determine interactions.

 

*edit* I actually took this from DST's files but yeah same swill for purposes of illustration XD

Edited by outseeker

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