An other way to get the Enemy location via script.
In this script i check the distance between red Airgroups and blue Airgroups. And if it lower as a given value, there will a Voice Message being generated to the ally Airgroups which are in range to the enemy. The script is not fully tested yet, i am to busy at the moment (home renovation

). Feel free to expand it, the voice files (use the filename without .ogg) are located in ..\Steam\SteamApps\common\il-2 sturmovik cliffs of dover\parts\bob\speech, you can add for example the type of the Enemy Aircrafts, their Numbers etc. The timedelay between the checks should be larger as in my example to avoid overlaping of the messages.
Code:
using System;
using System.Collections;
using System.Collections.Generic;
using maddox.game;
using maddox.game.world;
using maddox.GP;
public class Mission : AMission
{
public void sendMessagesToAirgroup(AiAirGroup from, double maxDistance)
{
AiAirGroup[] EnemyAirgroups;
Point3d StartPos = new Point3d(from.Pos().x, from.Pos().y, 1.0);
EnemyAirgroups = GamePlay.gpAirGroups((from.Army() == 1) ? 2 : 1);
int i = 0;
foreach (AiAirGroup aag in EnemyAirgroups)
{
Point3d enemyPosition = new Point3d(aag.Pos().x, aag.Pos().y, 1.0);
if (from.Pos().distance(ref enemyPosition) < maxDistance)
{
string sectorName = GamePlay.gpSectorName(aag.Pos().x, aag.Pos().y);
string[] splittet = sectorName.Split(',');
string alpha = splittet[0];
string number = "n" + splittet[1];
AiAircraft LeaderPlane = (from.GetItems()[0] as AiAircraft);
Timeout(i, () =>
{
(LeaderPlane as AiAircraft).SayToGroup(from as AiAirGroup, "Enemy_planes");
});
Timeout(i += 2, () =>
{
LeaderPlane.SayToGroup(from, "In_square");
});
Timeout(i += 2, () =>
{
LeaderPlane.SayToGroup(from, alpha);
});
Timeout(i += 2, () =>
{
LeaderPlane.SayToGroup(from, number);
});
i += 2;
}
}
}
public override void OnTickGame()
{
base.OnTickGame();
if (Time.tickCounter() % 600 == 299)
{
foreach(AiAirGroup aag in GamePlay.gpAirGroups(1))
sendMessagesToAirgroup(aag, 100000.0);
}
}
}