• 🏆 Texturing Contest #33 is OPEN! Contestants must re-texture a SD unit model found in-game (Warcraft 3 Classic), recreating the unit into a peaceful NPC version. 🔗Click here to enter!

Can't seem to get 'AttackMoveKillA' to work properly - Campaign AI

Status
Not open for further replies.
Level 11
Joined
Apr 27, 2009
Messages
202
Hello Adventurer's. I'm in grave need of your help. I'm learning how to make CampaignAI and have came to a problem.
I'm making my first super simple AI so I can learn. Attack creep camp (first group) --> user (second group) with AttackMoveKillA(crp)

I'm using WC3 Reforged with warpten (so the AI can build faster).

So the problem is AttackMoveKillA() doesn't work for me as expected.
What I'm I missing?

I'm trying to make the FIRST group of AI to CREEP camp then the SECOND group after the attack to attack the USER.

The problem is the second groups does the both attacks.
KNIGHTS from first InitAssaultGroup() do not attack nor move an inch they just get made and stand in the town.
The second group does attack the CREEP camp and after that the USER.
I'm super confused. Shouldn't the first InitAssaultGroup() attack the creep camp?

Could someone help a lad like me?

JASS:
globals
    player user = PlayerEx(1)
endglobals

function AttackUser takes nothing returns nothing

    local unit crp

// ATTACK LOOP
//-------------------------------------------------
    set crp = GetCreepCamp(0,9,false)
 
    loop        
        // *** WAVE 1 ***
        call InitAssaultGroup()
        call CampaignAttackerEx(2,2,3, KNIGHT)
        call Sleep(20)
        call AttackMoveKillA(crp)
        // ^^ The KNIGHTS just stand in town and AttackMoveKillA does nothing with 'call CampaignAttackerEx(2,2,3, KNIGHT)'
        // the first InitAssaultGroup is being ignored
        call Sleep(10)
 
        // *** WAVE 2 ***
        call InitAssaultGroup()
        call DisplayTextToPlayer(user,0,0,"Wave 2")
        call CampaignAttackerEx(1,2,3, FOOTMAN)
        call CampaignAttackerEx(1,2,3, RIFLEMAN)
        //  ^^ This GROUP attacks the creep camp and then the player I want the KNIGHT to attack the creep camp
        call SuicideOnPlayerEx(20,20,20, user)
        call DisplayTextToPlayer(user,0,0,"Wave 2 Attacked")
 
    endloop

endfunction

function main takes nothing returns nothing
        call CampaignAI(HOUSE,null)
        call SetReplacements(1,2,3)
        call SetSlowChopping(false)
        call SetPeonsRepair(true)
 
// BUILD ORDER
//-------------------------------------------------
 
        call SetBuildUnitEx(1,1,1,TOWN_HALL)
        call SetBuildUnitEx(8,8,8,PEASANT)
        call SetBuildUnitEx(1,1,1,BARRACKS)
        call SetBuildUnitEx(1,1,1,HUMAN_ALTAR)
        call SetBuildUnitEx(1,1,1,LUMBER_MILL)
        call SetBuildUnitEx(1,1,1,BLACKSMITH)
        call SetBuildUnitEx(1,1,1,KEEP)
        call SetBuildUnitEx(1,1,1,ARCANE_SANCTUM)
        call SetBuildUnitEx(1,1,1,WORKSHOP)
        call SetBuildUnitEx(1,1,1,CASTLE)
 
// DEFENDER ORDER
//-------------------------------------------------
 
        call CampaignDefenderEx(2,2,3,FOOTMAN)
        call CampaignDefenderEx(0,1,2,RIFLEMAN)
        //call CampaignAttackerEx(1,1,1,PALADIN)
 
        call WaitForSignal()
        call AttackUser()
 
endfunction
 

Attachments

  • TryOutAI.w3m
    38.3 KB · Views: 0
Last edited:
Status
Not open for further replies.
Top