• 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!
  • Read Evilhog's interview with Gregory Alper, the original composer of the music for WarCraft: Orcs & Humans 🔗Click here to read the full interview.

[AI] Campaign AI Thingy

Status
Not open for further replies.
Level 24
Joined
Feb 28, 2007
Messages
3,479
Working on a campaign, here's the AI script for the first map:
JASS:
globals
    player user = Player(1)
endglobals

function main takes nothing returns nothing
    call CampaignAI('h602',null)
    call SetSlowChopping(true)
    call SetPeonsRepair(true)

    call SetReplacements(0,1,2)
    call CampaignDefenderEx( 2,3,4, 'h604')
    call CampaignDefenderEx( 1,2,2, 'n607')

    //*** WAVE 1 ***
    call InitAssaultGroup()
    call CampaignAttackerEx( 3,4,4, 'h604')
    call SuicideOnPlayer(M1,user)

    loop
        //*** WAVE 2 ***
        call InitAssaultGroup()
        call CampaignAttackerEx( 2,2,3, 'h604')
        call CampaignAttackerEx( 2,3,3, 'n607')
        call SuicideOnPlayer(M3,user)

        //*** WAVE 3 ***
        call InitAssaultGroup()
        call CampaignAttackerEx( 3,4,4, 'h604')
        call CampaignAttackerEx( 1,1,2, 'n607')
        call SuicideOnPlayer(M3,user)

        //*** WAVE 4 ***
        call InitAssaultGroup()
        call CampaignAttackerEx( 1,2,2, 'h604')
        call CampaignAttackerEx( 2,2,4, 'n607')
        call SuicideOnPlayer(M4,user)
    endloop
endfunction
1. Does the code look good, or could it be improved?
2. Do I need to give the Computer Player a specific amount of starting units (excluding workers) depending on the AI script, such as the amount of defenders?
 
Status
Not open for further replies.
Top