I want a computer to work with an AI. I have it written here:
WHAT I NEED: I want to have that loop end and start a new loop when a quest is completed. I tried looking up how to do it, but I just could not figure it out. I don't know how to use the command "exitwhen" properly, so I was stuck.
WHAT I TRIED: I though maybe then I could write another code in a different file and use the trigger to star an AI script after the quest was completed. I though this would essentially REPLACE the first ai script and start using the second one, but it did not work. It continued sending waves like the first script said.
JASS:
globals
player user = Player(22)
player saurus = Player(1)
constant integer HALBERDIER = 'h600'
constant integer OUTRIDER = 'n608'
constant integer WORKER = 'h005'
constant integer SETTLEMENT = 'h000'
constant integer ESTFARM = 'h001'
constant integer ESTBARRACKS = 'h002'
constant integer ESTBLACKSMITH = 'h003'
constant integer ESTTOWER = 'h004'
endglobals
function main takes nothing returns nothing
call CampaignAI(HOUSE, null)
set campaign_wood_peons = 2
set campaign_gold_peons = 3
call SetReplacements(99,99,99)
call SetSlowChopping(true)
call SetPeonsRepair(true)
call WaitForSignal()
loop
call InitAssaultGroup()
call CampaignAttackerEx(3,3,3, HALBERDIER)
call CampaignAttackerEx(1,1,1, OUTRIDER)
call SuicideOnPlayer(60, saurus)
endloop
endfunction
WHAT I NEED: I want to have that loop end and start a new loop when a quest is completed. I tried looking up how to do it, but I just could not figure it out. I don't know how to use the command "exitwhen" properly, so I was stuck.
JASS:
loop
call InitAssaultGroup()
call CampaignAttackerEx(4,4,4, HALBERDIER)
call CampaignAttackerEx(2,2,2, OUTRIDER)
call SuicideOnPlayer(60, user)
endloop