ich hab weiter rumprobiert und jetzt eine lösung gefunden. für die die es interessiert ist hier ein script welches die o.g. aufgaben erfüllt.
gestartet wird es per:
Code:
psy = [player,shilka1] execVM "CB_laser.sqf";
player ist die einheit die das ziel angreifen soll (also die mit dem laserdesignator) und shilka1 das definierte ziel.
Code:
//by psycho
_laserunit = _this select 0;
_target = _this select 1;
_pos = [0,0,0];
_pos = position _target;
_target_tracked = false;
_sidep = side _laserunit;
_laserunit addweapon "laserdesignator";
_laserunit addmagazine "Laserbatteries";
//warte auf laserziel
while {alive _target} do
{
for [{_loop=0}, {_loop<1}, {_loop=_loop}] do
{
sleep 2;
_pos = position _target;
_laserT = (nearestObject [_pos, "LaserTarget"]);
//hint format ["Ziel: %1", _laserT]; //debug
if (!(isNull _laserT)) then {_loop = 1; hint "Ein Harrier ist auf dem Weg zum Ziel";};
};
//erzeuge harrier+wegpunkte
_posb = [(_pos select 0)-500 -(random 2000),(_pos select 1)+1000 -(random 2000),(200 + random 100)];
_pilot = createGroup (_sidep);
"USMC_Soldier_Pilot" createUnit [_posb, _pilot];Sleep 0.3;
_plane = createVehicle ["AV8B",_posb, [], 500, "FLY"];Sleep 0.1;
_plane setpos [getpos _plane select 0, getpos _plane select 1, 300];
_plane setdir (random 359);
_plane engineon true;
(units _pilot select 0) assignAsDriver _plane;
(units _pilot select 0) moveInDriver _plane;
_wp = _pilot addWaypoint [_target, 20];
_wp setWaypointStatements ["true", "touch_gbu = true"];
_wp2 = _pilot addWaypoint [_posb, 10];
{_x setBehaviour "combat"} forEach (units _pilot);
(driver _plane) commandMove _pos;
(driver _plane) doMove _pos;
_plane flyInHeight 300;
//erzeuge gbu
waitUntil {touch_gbu};
_bomb = "Bo_GBU12_LGB" createVehicle _pos;
_bomb setPos [(getPos _bomb select 0),(getPos _bomb select 1),30];
if (!(alive _target)) exitWith {};
sleep 1;
};