SMUnlimited / AMAI

Advanced Melee Artificial Intelligence Mod For Warcraft 3
Other
211 stars 34 forks source link

TeleportCaptain maybe override AttackMoveKill #447

Open jzy-chitong56 opened 4 days ago

jzy-chitong56 commented 4 days ago

Do need prevent it TeleportCaptain override AttackMoveKill ?? and not send TeleportCaptain when Combat

change all like

      if CaptainInCombat(true) then
        call AttackMoveKill(target)
      elseif c_ally_total > 0 and not ally_override then
        call TeleportCaptain(GetUnitX(target), GetUnitY(target)) // Override hardcoded logic from attackmovekill which will help allies
      endif
SMUnlimited commented 4 days ago

TeleportCaptain is being used to override attackmovekill target so yes that is intentional. In team games the attackmovekill command is often ignored based on hardcoded logic. But teleport captain forces us to target the right location and ignore the team target.

I haven't seen any problems with how it is currently in games, have you seen otherwise?

jzy-chitong56 commented 3 days ago

The main concern is that TeleportCaptain will send move commands, overwrite attack, and stop the unit's attacks. Normal attacks should not be interrupted, as this will weaken the battle

SMUnlimited commented 2 days ago

I''m going to revert this or at least leave disabled as its it is just dancing between the two locations, while at least before it prefers one or the other. I think i need to create our own attackmove system for combat to avoid using the hardcoded function.

jzy-chitong56 commented 4 hours ago

if true or here why is true ?? if need elseif always can not run , just del this code

        if true or CaptainAtGoal() or (attack_length_counter == 0 and not CaptainInCombat(true)) or CaptainInCombat(true) or ally_override or c_ally_total == 0 then
          call AttackMoveKill(u) // Use existing troops
        elseif (c_ally_total > 0 and not ally_override) then
          call CaptainAttack(GetUnitX(u), GetUnitY(u)) // Override hardcoded logic with attackmovekill as ally targets will change the attackmovekill we wanted. Teleport ignores the ally control.
        endif  
jzy-chitong56 commented 4 hours ago

if true or here why is true ?? if need elseif always can not run , just del this code

        if true or CaptainAtGoal() or (attack_length_counter == 0 and not CaptainInCombat(true)) or CaptainInCombat(true) or ally_override or c_ally_total == 0 then
          call AttackMoveKill(u) // Use existing troops
        elseif (c_ally_total > 0 and not ally_override) then
          call CaptainAttack(GetUnitX(u), GetUnitY(u)) // Override hardcoded logic with attackmovekill as ally targets will change the attackmovekill we wanted. Teleport ignores the ally control.
        endif  
SMUnlimited commented 19 minutes ago

I've disabled as it needs more work.

Ultimately needs to still do an attack move without going to help the allies. As all the alternative attack functions that don't attack the team target are not running an attack move.