//Get / set parameters _posCAS = position player; _dir = direction player; _disSpawn = 1000; //distance to spawn from CAS point; 3000 final value _altSpawn = 1000; //spawn altitude; 2000 final value _radius = 500; //radius of the pylon turn; 1000 final value //Create plane as per fn_efm_specialevents.sqf from official "Escape from Malden" //_posSpawn = [_posCAS, _disSpawn, (_dir + 180)] call BIS_fnc_relPos; _posSpawn = [_posCAS, _disSpawn, (_dir + 180)] call BIS_fnc_relPos; _plane = createVehicle ["B_T_VTOL_01_armed_F", _posSpawn, [], 0, "FLY"]; createVehicleCrew _plane; _planeCrew = crew _plane; _planeGroup = group (_planeCrew select 0); _planeGroup allowFleeing 0; //Apply flight parameters... //final height is supposed to b max(flyInHeight, flyInHeightASL), but this does not appear to be the case... //_plane flyInHeight 1000; //use 1000 here until issues with flyInHeightASL are resolved _plane flyInHeightASL [1000, 1000, 1000]; //flyInHeightASL seems to be broken //Apply waypoint parameters... _waypoint = _planeGroup addWaypoint [_posCAS, 0]; _waypoint setWaypointType "LOITER"; _waypoint setWaypointLoiterType "CIRCLE_L"; _waypoint setWaypointLoiterRadius _radius; _waypoint setWaypointBehaviour "AWARE"; _waypoint setWaypointCombatMode "YELLOW"; //Fire at will //Radio... [_plane, "CuratorModuleCAS"] call bis_fnc_curatorSayMessage; //No survivors... _null = [_plane, _planeCrew] spawn { waitUntil {sleep 2; !(isNull (_this select 0)) and {!(canMove (_this select 0))}}; {_x setDamage 1} forEach (_this select 1); }; //Retreat to spawn position if damaged or after timeout... _null = [_planeGroup, _plane] spawn { _t = time; waitUntil {sleep 5; (damage (_this select 1) > 0.35) or (time > _t + 300)}; _waypoint = _planeGroup addWaypoint [_posSpawn, 0]; if !(isnull _logic) then { sleep 1; deletevehicle _logic; }; }; // Delete when far away?? preferable to delete upon reaching vicinity of spawn position; check code from vanilla CAS functions waitUntil {sleep 5; ({(_x distance _plane) < (5000)} count (allPlayers) == 0)}; {deleteVehicle _x} forEach (_planeCrew + [_plane]); deleteGroup (_planeGroup);