AI's Script

soul_reaper

New Member
Reaction score
12
I found in Wc3campaigns a tutorial about JASS AI.
My problem is that the AI don't work and I have no idea why.
Here the Code
JASS:

//******************************************************************************
//*                           Human Campaign AI 1                              *
//*                                 By Soul_Reaper                             *
//******************************************************************************
globals
    player MyVictim = Player( 0 )
endglobals

function ConfigureAI takes nothing returns nothing
    call SetSlowChopping( false )
    call SetPeonsRepair( true )
endfunction
function main takes nothing returns nothing
    call CampaignAI( "h003", function hero_levels )
    call ConfigureAI( )
    // **********************************
    // *      Building Strategy         *
    // **********************************
    //
    // Tier 1 Buildings
    call SetReplacements( 1, 2, 3 )
    call SetBuildUnitEx( 1, 1, 1, "h001" )
    call SetBuildUnit( 15, "h000" )
    call SetBuildUnitEx( 3, 4, 7, "h003" )
    call SetBuildUnitEx( 1, 1, 2, "h004" )
    call SetBuildUnit( 1, "h007" )
    call CampaignDefenderEx( 2, 3, 5, "h002" ) 
    call CampaignDefenderEx( 1, 2, 3, "h005" )
    call SetBuildUnitEx( 1, 1, 2, "h00L" )
    call SetBuildUnitEx( 1, 1, 2, "h009" )
    // Tier 2 buildings
    call SetBuildUnit( 1, "h00F" )
    call SetBuildUnitEx( 1, 1, 1, "h00N" )
    call CampaignDefenderEx( 1, 1, 1, "h00D" )
    // **********************************
    // *    End Building Strategy       *
    // **********************************
    // **********************************
    // *       Attack Strategy          *
    // **********************************
    //*** WAVE 1 *** AI will begin to attack in 8,7,6 minutes
    call InitAssaultGroup()
    call CampaignAttackerEx( 2, 2, 3, "h002" )
    call CampaignAttackerEx( 0, 1, 2, "h005" )  
    call SuicideOnPlayerEx( M8, M7, M6, MyVictim )
    //*** Basic upgrades from Forge ***
    call SetBuildUpgrEx( 1, 1, 1, "R004" )
    call SetBuildUpgrEx( 0, 1, 1, "R005" )
    call SetBuildUpgrEx( 0, 1, 1, "R006" )
    call SetBuildUpgrEx( 0, 0, 1, "R007" )
    //*** WAVE 2 *** Between 3 minutes after Wave 1
    call InitAssaultGroup()
    call CampaignAttackerEx( 2, 3, 4, "h002" )
    call CampaignAttackerEx( 1, 1, 3, "h005" )  
    call SuicideOnPlayerEx( M3, M3, M3, MyVictim )
    call SetBuildUpgrEx( 0, 1, 1, "R004" )
    //*** WAVE 3 *** Between 3 minutes after Wave 2
    call InitAssaultGroup()
    call CampaignAttackerEx( 2, 3, 5, "h002" )
    call CampaignAttackerEx( 1, 1, 4, "h005" )
    call CampaignAttackerEx( 0, 0, 1, "h00D" )  
    call SuicideOnPlayerEx( M3, M3, M3, MyVictim )
    call SetBuildUpgrEx( 0, 1, 1, "R009" )
    call SetBuildUpgrEx( 1, 1, 1, "R006" )
    call SetBuildUpgrEx( 0, 0, 1, "R007" )
    loop //Init the infinite attack loop
    //*** WAVE 4 *** Between 3 minutes after Wave 3
    call InitAssaultGroup()
    call CampaignAttackerEx( 4, 5, 6, "h002" )
    call CampaignAttackerEx( 1, 2, 4, "h005" )
    call CampaignAttackerEx( 0, 1, 2, "h00D" )  
    call SuicideOnPlayerEx( M4, M3, M3, MyVictim )
    endloop
    // **********************************
    // *   Attack Strategy never ends   *
    // **********************************
endfunction
 

soul_reaper

New Member
Reaction score
12
You mean :
Trigger:
  • AI - Start campaign AI script for Player 4 (Purple): war3mapImported\Human AI 1.ai
?
 
General chit-chat
Help Users
  • No one is chatting at the moment.

      The Helper Discord

      Members online

      No members online now.

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top