Hi guys,
Thanks for the reply.
I know LUADOC page but we cannot really say it is a documentation since the functions are not explained
I thought that all CaiBrain functions were available only when playing with AI.
Good to know that we can use it anywhere.
What is the "coverage" of GetUnitsAroundPoint()? Is that covering the whole map?
Regarding GetEnemyUnitsInSphere. We are using it in a thread running on the opponent "priority" unit:
- Code: Select all
while not self:IsDead() and self:HasGlobalPriority() do
local EnemyUnits = GetEnemyUnitsInSphere(self:GetArmy(), self:GetPosition(), 128)
local GlobalPriority = self:GetGlobalPriority()
if EnemyUnits and table.getn(EnemyUnits) > 0 then
for j,k in EnemyUnits do
if not k:IsPriorityTarget(GlobalPriority, self) then
local distance = GetDistanceBetweenTwoEntities(self, k)
if (distance <= k:GetMaxPriorityRange()) then
k:AddPriorityTarget(GlobalPriority, self)
end
end
end
end
WaitSeconds(1)
end
If the priority unit is a land unit and a bomber is flying above that unit, the GetEnemyUnitsInSphere func is not reporting it unless the plane starts its landing approach.
I'm not exactly sure how X, Y, Z axis are used in FA but usually Y represents the height and I find strange that it is not used anywhere.
Does GetUnitsInRect actually represents a rectangular parallelepipedal? since Y axis is not present it does not seem to be the case except if the function consider the coordinates infinite on that axis.
Thanks