- Joined
- Mar 21, 2009
- Messages
- 7
I've noticed in Blizzard campaign maps where there are waves of armies spawn that instead of issuing attack-move order to units, they're using a custom AI to do it. I decided to extract the one used in the last Rexxar mission (o03Bx08.ai) out and try to implement it in a castle defense map.
Can anyone explain to me how does this AI work?
Also, is this more efficient than just using trigger to issue order everytime a wave of enemies spawns?
Can anyone explain to me how does this AI work?
JASS:
globals
integer user = 3
endglobals
function main takes nothing returns nothing
call CampaignAI(HOUSE,null)
call PrepFullSuicide()
loop
loop
exitwhen CommandsWaiting() == 0
set user = GetLastCommand()
call PopLastCommand()
endloop
call SuicideUnitB(FOOTMAN,user)
call SuicideUnitB('h004',user)
call SuicideUnitB(RIFLEMAN,user)
call SuicideUnitB('h005',user)
call SuicideUnitB(KNIGHT,user)
call SuicideUnitB('h006',user)
call SuicideUnitB('h007',user)
call SuicideUnitB('nchp',user)
call SuicideUnitB('nhym',user)
endloop
endfunction
Also, is this more efficient than just using trigger to issue order everytime a wave of enemies spawns?