Company of Heroes: Eastern Front

Author Topic: AI bugs: PLEASE READ BEFORE POSTING  (Read 31161 times)

Offline seth36

  • Ingenery
  • *
  • Posts: 2
    • View Profile
Re: AI bugs: PLEASE READ BEFORE POSTING
« Reply #45 on: January 03, 2021, 03:55:50 PM »
Quote
I added the processing parameters to nil:

Quote
function TacticFilter_TeamWeapon_Quick_Vehicle (squad)

--Robotnik: Quick tanks should circle around and hit the rear of team weapons, especially AT guns
--This Filter determines if its a team weapon, and whether the personality files allow it
if (not s_personality.tankmove_tactic_strafe_weapon_teams) then
return false
end

         if (sim_squad == nil) then
           return false
end

         if (target_squad == nil) then
return false
end

return SquadIsInFront (sim_squad, target_squad)

end

Hi, sorry if I'm missing something completely new here but I have a similar issue and wondering about this fix - Surely the logic added here is wrong? Neither sim_squad or target_squad are local variables defined within this method which (without being familiar with the specifics of this language as I cant see these as global) would evaluate to nill always and therefore the method just always returns false and effectively does nothing?

Cobbling this together from similar code I would expect the fix would make more sense as this for TacticFilter_TeamWeapon_Quick_Vehicle ??

Quote
function TacticFilter_TeamWeapon_Quick_Vehicle(squad)

   --Robotnik: Quick tanks should circle around and hit the rear of team weapons, especially AT guns
   --This filter determines if its a team weapon, and whether the personality files allow it
   if (not s_personality.tankmove_tactic_strafe_weapon_teams) then
      return false
   end

   -- define sim_squad and check the value
   local sim_squad = AISquad_ConvertToSimSquad(squad)
   if (sim_squad == nil) then
      return false
   end

   -- define target_squad and check the value
   local target_squad = SquadQuery_GetAnySquadCombatTarget(sim_squad)
   if (target_squad == nil) then
      return false
   end
   
   return SquadIsInFront(sim_squad, target_squad)

end

That way the filter performs intended actions since we now have these variables worked out and can be passed to SquadIsInFront?

In my case I'm hitting 2 similar AI errors which are:

Quote
ERROR - Player 1002 AITactic AIVechicleTactic failed to call filter TacticFilter_TankMove_AllyMedium

And

Quote
ERROR - Player 1003 AITactic AIVechicleTactic failed to call filter TacticFilter_TankMove_AxisLight

I can't for the life of me find where these are being called from - My version is 2.30 - I can't update to 2.4 because I have the retail version from disc and steam doesnt let you download the mod if it doesnt find a steam version of the game installed so i had to get the older version from moddb - I saw the changelog for 2.4 references a typo causing an AI error

Is this where it says "AIVechicleTactic" rather than "AIVehicleTactic" ? Can't see if that is the typo being referred to or if Vehicle is meant to be spelt wrong here.

I'm going to just do an attempt with adding these placeholder methods to my tactics.ai to see if it helps:

Quote
function TacticFilter_TankMove_AllyMedium(squad)
   return TacticFilter_TankMove(squad)
end

function TacticFilter_TankMove_AxisLight(squad)
   return TacticFilter_TankMove(squad)
end

As i can't find anywhere those filters are defined but any info on this would be great, thanks.

EDIT Apologies for using quote blocks for the code snippet - I tried to use the code tags but the forum just keeps complaining I can't post external links which I'm not
« Last Edit: January 03, 2021, 04:34:25 PM by seth36 »