Desblat Posted December 26, 2013 Share Posted December 26, 2013 (edited) Hi!I'm currently working on a mod (3 player coop - http://steamcommunity.com/sharedfiles/filedetails/?id=172291214) and we have 1 really big problem with 2player, he cannot attack(I press attack button 2player turns to enemy-target, but does nothing. Here is code what 2player use to attack: {Code from 2player controlling (file in mod-folder called "playercontroller_3")}Function PlayerController_3:DoAttackButton()local attack_target = self:GetAttackTarget()if attack_target and self.inst.components.combat.target ~= attack_target thenlocal action = BufferedAction(self.inst, attack_target, ACTIONS.ATTACK)self.inst.components.locomotor:PushAction(action, true)elsereturnendend Function PlayerController_3:AttackActClear()self.inst:RemoveTag("attackest")self.inst.components.locomotor:Clear()local target = nilself.inst.components.combat:GiveUp()end {Code from 2player brain (file in mod-folder called "summonclonebrain")} function summonclonebrain:OnStart()local root = PriorityNode({WhileNode( function() return self.inst.components.combat.target and self.inst:HasTag("attackest") end, "AttackMomentarily",ChaseAndAttack(self.inst, MAX_CHASE_TIME) ), },0)self.bt = BT(self.inst, root)end You can download it from here http://rghost.ru/51218588 Thanx for reading, if somebody know how to fix this, please help. Edited December 26, 2013 by Desblat Link to comment https://forums.kleientertainment.com/forums/topic/30575-questionattack-problem/ Share on other sites More sharing options...
Desblat Posted January 2, 2014 Author Share Posted January 2, 2014 Alredy fixed. Link to comment https://forums.kleientertainment.com/forums/topic/30575-questionattack-problem/#findComment-397053 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