I am looking to alter some coding and do a battle on a small scale.
The idea is have a Front line marker set in Red and a frontline marker set in Blue (all over land). But also a 3rd set of markers inbetween the two battle lines that are Nutral. So the marker is not 1 or 2.
The idea is then the tanks would first attack Nearest Nutral markers as they advance Else attack nearest Enemy marker.
Code below tackles the issue of nearestEnemyMarker, but anyone have an idea of how to set them to attack and then take over a Nutral Frontmarker?
there is a lot more to the below coding but this points out the "attack nearest enemy.
Do I need to set up a int or bool at the begining stating Frontmarker 0 = Frontmarker nutral or something?
Code:
Point3d counterPoint = new Point3d(nearestEnemyMarker.x,nearestEnemyMarker.y,0);
if(25000 > counterPoint.distance(ref startPoint))
{
Timeout(60, () =>
{
if(army == MissionMarkers[mmIndex].army)
{ // if still under control launch new combat
if(!FrontMissions.Exists(_x => _x.x == counterPoint.x && _x.y == counterPoint.y))
{
CreateTankMission(startPoint, army);
CreateTankMission(counterPoint, enemy);
};
};
});
};
}