rons0n Posted April 21, 2015 Share Posted April 21, 2015 (edited) So one of my characters has a follower and it ALWAYS dies to the tentacles. Is it possible to make it so my follower completely ignores tentacles + does not get aggro'ed when the tentacle swipes at the owner? I just want the follower to ignore tentacles completely while being immune to them at the same time. Much is appreciated! Edit:I forgot to say that i'm using Abigail's brain. Not a custom one. Edited April 21, 2015 by rons0n Link to comment Share on other sites More sharing options...
DarkXero Posted April 22, 2015 Share Posted April 22, 2015 I am going to assume your follower is an Abigail's clone. Abigail's brain doesn't affect Abigail's targets. If your follower doesn't have the character, monster, or animal tag, the tentacles will ignore it unless it hits them.Your character shouldn't have these tags if it's like Abigail. So the problem is that Abigail is hitting the tentacles. Abigail's retarget function makes her mad against tentacles or anything that is targeting you, or you targeting them.So you want this:local function Retarget(inst) return FindEntity(inst, 20, function(guy) return inst._playerlink ~= nil and inst.components.combat:CanTarget(guy) and (guy.components.combat.target == inst._playerlink or inst._playerlink.components.combat.target == guy) and guy.prefab ~= "tentacle" end)endand Abigail won't target the tentacle. However... Abigail has an aura that hits (auratest(inst, target)):- not the player linked to her- Abigail's combat target- entities with their combat target as Abigail or Wendy- not the player that she follows, or the entities that follow the player- something that is not he player, is monster or is prey so what we do is add something to make the aura not attack the tentacle, pissing it off:local function auratest(inst, target) if target and target.prefab == "tentacle" then return false end if target == inst._playerlink then return false end if inst.components.combat.target == target then return true end local leader = inst.components.follower.leader if target.components.combat.target ~= nil and (target.components.combat.target == inst or target.components.combat.target == leader) then return true end if leader ~= nil and (leader == target or (target.components.follower ~= nil and target.components.follower.leader == leader)) then return false end return not target:HasTag("player") and target:HasTag("monster") or target:HasTag("prey")end Link to comment Share on other sites More sharing options...
rons0n Posted April 22, 2015 Author Share Posted April 22, 2015 (edited) As expected, your recommended changes were the trick I needed to stop the follower from being an enraged suicidal lunatic.But if a tentacle does manage to smack it, shes in forever long stunlock because the tentacle just attacks non-stop. Is there anyway to just make it so shes completely immune to the stunlock and damage of the tentacles? Thanks btw! Edited April 22, 2015 by rons0n Link to comment Share on other sites More sharing options...
DarkXero Posted April 22, 2015 Share Posted April 22, 2015 @rons0n, put this after adding the combat component:local self = inst.components.combatlocal old = self.GetAttackedfunction self:GetAttacked(attacker, damage, weapon, stimuli) if attacker and attacker.prefab == "tentacle" then return true end return old(self, attacker, damage, weapon, stimuli)end Link to comment Share on other sites More sharing options...
rons0n Posted April 22, 2015 Author Share Posted April 22, 2015 @DarkXero This worked wonderfully! No longer do I have to see my follower needlessly die to tentacles because of infinite stunlock. This also removes the exploit of having the follower kill off tentacles freely! Thanks as always, DarkXero! Link to comment 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