1. CpuManager:FindClosestPostToBase(iMaxRange, bBackBuild)
Call :
elseif (sPlacement == "BaseBack") then -- Try to build at closest post behind the base build_pos = cpu_manager:FindClosestPostToBase(40, true)
as well as within this function :
if (enemy_cnt > 0) then dist_sum = dist_sum / enemy_cnt dist_sum = dist_sum + math.random( 0, 30 ) table.insert( dist_tbl, {dist_sum, enemy_cnt, strat_pos} ) end
2. CpuManager:FindClosestEnemyPlayer( attack )
--add random distance if we want to choose target for attack --this will randomize a bit if two targets are nearby if attack ~= nil and attack == true then new_distance = new_distance + math.random( 0, 10 ) end
Edited by LarkinVB, 15 May 2006 - 09:05 PM.