- Joined
- Feb 2, 2006
- Messages
- 1,630
In my campaign AI I configure workers like that:
However, I saw that in the thread which sets the actual workers for a campaign AI:
It always resets the wood workers to 0 when the captain is in combat?! Why does this happen? Is it done for Ghouls of UD?! I am not even sure who the captain is when my AI attacks (their hero?!). I do not specify any captain in my attack waves:
Will it be the hero and why should the wood harversters be 0 then?! How can I prevent it? The AI needs more wood.[/CODE]
Code:
function ConfigureAI takes nothing returns nothing
call SetTargetHeroes( true )
call SetUnitsFlee( true )
call SetHeroesFlee( true )
call SetPeonsRepair( true )
call SetHeroesBuyItems( true )
call SetHeroesTakeItems( true )
call SetSlowChopping( false )
call SetWatchMegaTargets( true )
call SetIgnoreInjured( false )
call SetGroupsFlee( true )
//call SetCaptainChanges ( true )
call SetSmartArtillery ( true )
call SetGoldPeons(8)
call SetWoodPeons(5)
endfunction
However, I saw that in the thread which sets the actual workers for a campaign AI:
Code:
//============================================================================
function CampaignBasicsA takes nothing returns nothing
local integer food_each = GetFoodMade(racial_farm)
local integer on_wood
call ClearHarvestAI()
if CaptainInCombat(false) then
set on_wood = 0 // WHY???????????????????
else
set on_wood = campaign_wood_peons
endif
call HarvestGold(0,campaign_gold_peons)
call HarvestWood(0,on_wood)
if harvest_town1 then
call HarvestGold(1,campaign_gold_peons)
call HarvestWood(1,on_wood)
endif
if harvest_town2 then
call HarvestGold(2,campaign_gold_peons)
call HarvestWood(2,on_wood)
endif
if harvest_town3 then
call HarvestGold(3,campaign_gold_peons)
call HarvestWood(3,on_wood)
endif
if do_campaign_farms and FoodUsed()+food_each-1 > food_each*(TownCount(racial_farm)+1) then
call StartUnit(TownCount(racial_farm)+1,racial_farm,-1)
endif
if build_campaign_attackers then
call BuildAttackers()
endif
if not CaptainInCombat(false) then
call BuildDefenders()
endif
call FillGuardPosts()
call ReturnGuardPosts()
endfunction
It always resets the wood workers to 0 when the captain is in combat?! Why does this happen? Is it done for Ghouls of UD?! I am not even sure who the captain is when my AI attacks (their hero?!). I do not specify any captain in my attack waves:
Code:
call InitAssaultGroup()
call CampaignAttackerEx( 2, 3, 3, DEMON_OVERLORD )
call CampaignAttackerEx( 0, 1, 2, DEMON_FEL_STALKER )
call PurchaseZeppelin()
call AttackWithMount()
call CampaignAttacker( 0, 1, hero_id )
call Sleep( M3 ) // Waits 3 minutes before attacking
call LaunchAttack()
Will it be the hero and why should the wood harversters be 0 then?! How can I prevent it? The AI needs more wood.[/CODE]