Hello. One of the AIs on one of my maps does no longer build garrison units. Here's the code:
Now, the map uses custom units. As far as I can tell, the AI has no trouble with those: The attack waves are produced just fine and on time. However, the AI will not train any garrison units. Even in the same map, the other AI's (which also use custom units, but different ones) do train their garrisons properly. This one, however, will train only the attack waves.
All AI's start with plenty of resources and buildings (no units though, I still haven't figured out completlely how guards work).
Does anyone know what could be happening here?
(NOTE: For clarity; "Nest", "Roost" and "Perch" are buildings, with everything else being units (with the "Hatch" being the worker).)
JASS:
//------------------------------------------------
// GLOBALS
//------------------------------------------------
globals
player user = Player(0)
constant integer MOM = 'N00J'
endglobals
//------------------------------------------------
// MAIN
//------------------------------------------------
function main takes nothing returns nothing
call CampaignAI(PERCH, null)
call DoCampaignFarms(true)
call SetHeroesFlee(false)
call SetGroupsFlee(false)
call SetReplacements(0, 0, 0)
call SetSlowChopping(true)
call SetPeonsRepair(true)
call SetBuildUnitEx(2, 2, 2, NEST)
call SetBuildUnitEx(7, 7, 7, HATCH)
call SetBuildUnitEx(3, 3, 3, ROOST)
call SetBuildUnitEx(3, 3, 3, ROGUE)
call SetBuildUnitEx(2, 2, 2, WIND)
call SetBuildUnitEx(2, 2, 2, HAG)
call SetBuildUnitEx(7, 7, 7, PERCH)
call CampaignDefenderEx(3, 3, 3, ROGUE)
call CampaignDefenderEx(2, 2, 2, WIND)
call CampaignDefenderEx(2, 2, 2, HAG)
call CampaignDefenderEx(1, 1, 1, MOM)
call WaitForSignal()
// WAVE 1
call InitAssaultGroup()
call CampaignAttackerEx(2, 3, 4, EXPLORER)
call CampaignAttackerEx(1, 2, 2, WIND)
call SuicideOnPlayerEx(240, 240, 240, user)
loop
// WAVE 2
call InitAssaultGroup()
call CampaignAttackerEx(3, 3, 4, EXPLORER)
call CampaignAttackerEx(1, 1, 2, ROGUE)
call CampaignAttackerEx(0, 1, 1, WIND)
call SuicideOnPlayerEx(360, 360, 360, user)
// WAVE 3
call InitAssaultGroup()
call CampaignAttackerEx(3, 3, 4, ROGUE)
call CampaignAttackerEx(2, 2, 2, WIND)
call SuicideOnPlayerEx(360, 360, 360, user)
// WAVE 4
call InitAssaultGroup()
call CampaignAttackerEx(3, 3, 4, EXPLORER)
call CampaignAttackerEx(3, 3, 4, ROGUE)
call SuicideOnPlayerEx(360, 360, 360, user)
endloop
endfunction
Now, the map uses custom units. As far as I can tell, the AI has no trouble with those: The attack waves are produced just fine and on time. However, the AI will not train any garrison units. Even in the same map, the other AI's (which also use custom units, but different ones) do train their garrisons properly. This one, however, will train only the attack waves.
All AI's start with plenty of resources and buildings (no units though, I still haven't figured out completlely how guards work).
Does anyone know what could be happening here?
(NOTE: For clarity; "Nest", "Roost" and "Perch" are buildings, with everything else being units (with the "Hatch" being the worker).)




