- Joined
- Feb 28, 2007
- Messages
- 3,479
Working on a campaign, here's the AI script for the first map:
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?
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
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?