Standing on the shoulders of those who have far more skill than me, I have created the following SQF that seems to work, OK. ID-CPL. Venori, who ever you are, thank you.
It has some limitations in that ingress and egress points need to be predefined. I threw in the outbound heading from the ingress point just so that the marker could be placed anywhere and the spawned choppers could at least be moving in the desired direction toward the center of the map (I thought that made the most sense).
What I would like to do is click 3 points in the map, instead.
Ingress location
CAS location
Egress location
Ingress and CAS locations would define an inbound vector whos direction could be assigned to the spawn function
The same vector could be used to generate a spawn point at some distance from the CAS point along that vector, say 10K meters out. Pythagorean therom would apply if I am not mistaken.Code:[[(getMarkerPos _in) select 0, (getMarkerPos _in) select 1, 50], _az, "AH1Z", CAS_cg] call BIS_fnc_spawnVehicle;
Just the same, the CAS point and egress point could be used to create an exit vector and the egress point would then just be 10K meters out along that vector.
I need a little nudge in the right direction on what to read up on so that I can get the vector stuff working. Any suggestions you have are also appreciated.
Code:// SQF for ARMA II // Call in 2-ship CAS strike (search and destroy) on position as marked on map // Butchered by LawnDartLeo from the work of ID-CPL. Venori (it's more him than me) // Place Functions module, "egress" and "ingress" markers on the map. Set outbound heading desired from ingress point. // Use -> null = ["ingress","egress",<0-359>] execVM "CAS_cobra.sqf"; in trigger using radio call. /* null = ["ingress","egress",obh] execVM "CAS_cobra.sqf"; */ // Input _in = _this select 0; // ingress marker name _out = _this select 1; // egress marker name _az = _this select 2; // ingress point outbound heading // Config _mapMarkText = "Click on the map to designate the CAS strike area"; _closeMapMessage = "Close the map to initiate CAS strike"; _CASpoint = "CAS_StrikeMarker"; _CASMarkerType = "hd_destroy"; _incomingMessage = "Cobra1 inbound for CAS strike on smoke, please stand by..."; // Map click to determine where the strike will occur. CAS_Strikemarked = true; hint _mapMarkText; _mapString = format["CAS_StrikeMarker = createMarker [""%1"", _pos]; ""%1"" setMarkerType ""%2"";;CAS_Strikemarked=false",_CASpoint, _CASMarkerType]; onMapSingleClick _mapString; waitUntil{!CAS_Strikemarked}; onMapSingleClick ""; // Wait till they close the map to continue. hint _closeMapMessage; waitUntil{!visibleMap}; hintSilent ""; // Have the player toss smoke to mark the spot. player playAction "ThrowGrenade"; sleep 2; smoker = "SmokeShellRed" createVehicle (getMarkerPos "CAS_StrikeMarker"); // Create the group and spawn 2 AH1Z named CAS_h1 and CAS_h2 CAS_cg = creategroup west; _dp = [[(getMarkerPos _in) select 0, (getMarkerPos _in) select 1, 50], _az, "AH1Z", CAS_cg] call BIS_fnc_spawnVehicle; sleep 2; _dp2 = [[(getMarkerPos _in) select 0, (getMarkerPos _in) select 1, 50], _az, "AH1Z", CAS_cg] call BIS_fnc_spawnVehicle; CAS_h1 = _dp select 0; CAS_h2 = _dp2 select 0; CAS_planelist = [CAS_h1,CAS_h2]; // Set behaviour CAS_h1 setCombatMode "Red"; CAS_h2 setCombatMode "Red"; CAS_h1 setBehaviour "aware"; CAS_h1 setBehaviour "aware"; // Set the first waypoint to where the marker was placed, second to the egress point. _wp = CAS_cg addWaypoint [getMarkerpos _CASpoint, 1]; _wp setWaypointType "SAD"; _wp1 = CAS_cg addWaypoint [getMarkerPos _out, 2]; // Delete the crew and planes once they hit the egress point. [CAS_cg, 2] setWaypointStatements ["true", "{{deleteVehicle _x} forEach crew _x;} foreach units CAS_cg; {deletevehicle _x} foreach CAS_planelist;"]; // Alert player that the CAS strike is incoming. sleep 5; (driver CAS_h1) sideChat _incomingMessage;
HOME
Reply With Quote





