Listen to a special audio message from Bill Roper to the Hive Workshop community (Bill is a former Vice President of Blizzard Entertainment, Producer, Designer, Musician, Voice Actor) 🔗Click here to hear his message!
How do I make an AI to not just come to the enemy and kill few buildings and retreat, then come again and repeat this step. I need him to destroy the whole base, no back going.
I believe the problem is he retreats every time the unit count drops below "Minimum forces for attack". Since units can't join the attack group while it is out of base, he will eventually run out of units and run away to his base, and there realize he once again has enough units and attack again.
So there are two ways to solve this: either drop minimum forces requirement, when there is no resistance (not sure how to do this), or force him to replace fallen units, by launching new attack, while the previous attack is still in progress. That can be done by altering following function:
JASS:
function AttackAssignment takes nothing returns nothing
call StaggerSleep( 0, 2 )
if (attackWave == 1) then
call AttackWaveDelay( 0 )
endif
loop
loop
call UpdateConditions( )
exitwhen (HaveMinimumAttackers() and not CaptainRetreating())
call Sleep( 2 )
endloop
call RemoveInjuries( )
call ResetAttackUnits( )
call PrepareForces( )
call LaunchAttack( )
endloop
endfunction
By removing the and not CaptainRetreating(). That condition prevents AI from launching new attack while captain is out in field, retreating. It will also allow to "clear" one creep camp after another, not having to return to base after each one, which is also a pretty good feature.
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.