- Joined
- Oct 6, 2015
- Messages
- 5
Hello everyone, I followed Moyack's campaign AI tutorial and came up with this, though the computer won't create any units. I have imported the .ai file and used a trigger that starts it, so I believed there is something up with the code. I'll be thankful for any help, thanks!
Code:
globals
player User = Player( 0 )
endglobals
function ConfigureAI takes nothing returns nothing
call SetSlowChopping( true )
call SetPeonsRepair( true )
endfunction
function hero_levels takes nothing returns integer
local integer hero = GetHeroId()
local integer level = GetHeroLevelAI()
local integer a = 0
if hero == 'Nbbc' then
if level == 7 then
set a = 'AOww'
endif
if level == 8 then
set a = 'ANr3'
endif
endif
return a
endfunction
function main takes nothing returns nothing
call CampaignAI( 'otrb', function hero_levels )
call ConfigureAI( )
//*DEFENSE
call SetReplacments(99, 99, 99)
call CampaignDefenderEx( 2, 2, 2, 'nrwm' )
call CampaignDefenderEx( 1, 1, 1, 'nbal' )
call CampaignDefenderEx( 1, 1, 1, 'ninf' )
//*ATTACKING
/*Wave 1
call InitAssualtGroup()
call CampaignAttackerEx( 5, 5, 5, 'nchg' )
call CampaignAttackerEx( 4, 4, 4, 'nchw' )
call CampaignAttackerEx( 4, 4, 4, 'nchr' )
call SuicideOnPlayerEx( M3, M3, M3, User )
/*Wave 2
call InitAssaultGroup()
call CampaignAttackerEx( 2, 2, 2, 'ninf' )
call CampaignAttackerEx( 3, 3, 3, 'nbal' )
call CampaignAttackerEx( 1, 1, 1, 'Nbbc' )
call SuicideOnPlayerEx( M4, M4, M4, User )
endfunction
Last edited: