Thomas Die Posted December 18, 2018 Share Posted December 18, 2018 (edited) when i was coding everything was working but the companion refuses to do anything and just sits there like a lemon if you can help that would be awsome require "behaviours/wander" require "behaviours/faceentity" require "behaviours/chaseandattack" require "behaviours/panic" require "behaviours/runaway" local MAX_CHASE_TIME = 15 local WANDER_DIST = 20 local RUN_AWAY_DIST = 0 local STOP_RUN_AWAY_DIST = 3 local START_FACE_DIST = 5 local KEEP_FACE_DIST = 8 local MIN_FOLLOW_DIST = 1.5 local MAX_FOLLOW_DIST = 6 local MAX_WANDER_DIST = 1 local TARGET_FOLLOW_DIST = 3 local function GetFaceTargetFn(inst) return inst.components.follower.leader end local function KeepFaceTargetFn(inst, target) return inst.components.follower.leader == target end local PerdBrain = Class(Brain, function(self, inst) Brain._ctor(self, inst) end) -------------------------------------------------------------------------- function PerdBrain:OnStart() local root = PriorityNode( { ChaseAndAttack(self.inst, MAX_CHASE_TIME), Follow(self.inst, function()return self.inst.components.follower.leader end, MIN_FOLLOW_DIST, TARGET_FOLLOW_DIST, MAX_FOLLOW_DIST), FaceEntity(self.inst, GetFaceTargetFn, KeepFaceTargetFn), }, .25) self.bt = BT(self.inst, root) end return PerdBrain Edited December 18, 2018 by thomas4845 forgot something Link to comment Share on other sites More sharing options...
Ultroman Posted December 18, 2018 Share Posted December 18, 2018 1. Did you actually add the brain to your companion? 2. Did you consider that the game might have a problem with your brain having the same name as an existing brain? Link to comment Share on other sites More sharing options...
Thomas Die Posted December 18, 2018 Author Share Posted December 18, 2018 no the it's for the perd so for both yes never mind it was the gobbler's coding sorry but thnx for trying to help Link to comment Share on other sites More sharing options...
Ultroman Posted December 18, 2018 Share Posted December 18, 2018 (edited) OK, good It looks like you're missing the chaseandattack behaviour. Edited December 18, 2018 by Ultroman 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