renetta96 Posted March 16, 2020 Share Posted March 16, 2020 Hi everyone, In Don't Starve Together, I can add "companion" tag to prefabs to indicate that they are friendly entities, and force attack action should ignore them. However, I cannot do that in Don't Starve. The force attack only ignores followers, but still picks companion target. Does anyone know how force attack chooses targets in Don't Starve? How can I make it ignore some entities? Link to comment https://forums.kleientertainment.com/forums/topic/116458-force-attack-stills-target-entities-with-companion-tag/ Share on other sites More sharing options...
krylincy Posted March 30, 2020 Share Posted March 30, 2020 you can look into the combat.lua for the force attack target checking: function Combat:IsValidTarget(target) if not target or not target:IsValid() or not target.components or not target.components.combat or not target.entity:IsVisible() or not target.components.health or target == self.inst or target.components.health:IsDead() or (target:HasTag("shadow") and not self.inst.components.sanity) or Vector3(target.Transform:GetWorldPosition()).y > self.attackrange then return false else return true end end you could remove the combat component on your prefab or overwrite the force attack function function Combat:ForceAttack() if self.target and self:TryAttack() then return true else self.inst:PushEvent("doattack") end end and add a special tag from your prefab to avoid attacking 1 Link to comment https://forums.kleientertainment.com/forums/topic/116458-force-attack-stills-target-entities-with-companion-tag/#findComment-1320630 Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now