Hello. I've recently got involved into refining the skirmish AI 3.2, improving races that are consistently losing against space marines and tau (these have shown to be the best) in 1v1. I've made a lot of progress with improving the build orders, tactics, ability usage and fixed a couple of bugs.
However, a big obstacle has come up which I did not expect to exist: there is no way that I see for the AI to tell one of its squads to attack a specific enemy squad or building. There are plenty of examples where this would be useful, I will post one: I want vindicare assassins to prioritize commander units when they show up in assassin's firing range. Here is the DoAbilities() function that would do this if I could replace DoAttackMove(vTargetPos) with something like DoAttack(oEnemy). As far as I know the DoAttack() function, or one like it, simply does not exist. The AI can only attack with attack moves which really surprised me, since players can just right click the enemy to attack. Can anyone help?
function AssassinTactic:DoAbilities() print(self.squad_ai:GetSquadName() .. " is checking for commanders in range of assassination scope") local oFunctor = function(oSquad) return (oSquad:GetSquadName() == "tau_ethereal_squad") -- Just check for tau_ethereal_squad for now end local oEnemy = cpu_manager:FindClosestEnemy(self.squad_ai:GetPosition(), 50, oFunctor) if (oEnemy ~= nil) then print("Found a squad " .. oEnemy:GetSquadName()) if (self.squad_ai:CanDoAbility(Assassin.assassinate_id)) then print("Found a squad " .. oEnemy:GetSquadName() .. " Activating assassination scope.") Ability.DoAbility( self.squad_ai, Assassin.assassinate_id, Ability.PredicateFilters.ConstantTrue) end local vEnemyPos = oEnemy:GetPosition() local vTargetPos = Vector3f(vEnemyPos) --cpu_manager:DoMove(self.squad_ai, vTargetPos, true, "Attacking") self.squad_ai:DoAttackMove( vTargetPos ) -- This command indeed just attack moves to target so it does not guarantee that this specific target will be shot end end