Jump to content
Sign in to follow this  

Plane fly to Marker on map and drop Bombs?

Recommended Posts

I have spawned to planes without a GAU-8 cannon. I've adde lots of Boms and an trigger that the planes only fly into the battlefield if i activate the trigger via Radio Delta.

Is there a way to add a marker via Map (M) and the plane drop 12 Bombs there?

Regards ^^

Share this post

Link to post
Share on other sites


action useweapon

These two should get you in the right direction. Thrown together with distance checks and createVehicle you should be able to create something. I'd do it for you but I'm kinda busy managing my spaceship :P

Share this post

Link to post
Share on other sites

Create your vehicles, create an empty HPad named ASTarget. Create a marker named "target". Execute like this:

nul = [player,plane1,plane2] execVM "airstrike.sqf";


setfire = false;

onmapsingleclick {

//We only need it once
onmapsingleclick {};

// Set the position
ASTarget setpos _pos;

"target" setmarkerpos _pos;

// Convert the marker to a Destroy marker (skip this if you've already preplaced one in the editor as Destroy marker)
"target" setMarkerType "DESTROY";
"target" setMarkerShape "ICON";

// Use variable to kick off next part of script
setfire = true;

waitUntil {setfire};
_pl1 = _this select 1;
_pl2 = _this select 2;
_caller = _this select 0;

_pl1 doMove (getmarkerpos "target");
_pl2 doMove (getmarkerpos "target");
_pl1 doTarget (markerpos "target");
_pl2 doTarget (markerpos "target");

waitUntil {_pl1 distance (markerpos "target") < 200 && _pl2 distance (markerpos "target") < 200};
for "_i" from 0 to (floor(random 3)) do {
gameLogic action ["UseWeapon",_pl1,driver _pl1,2]; // You need a gamelogic (F1 - GameLogic - Gamelogic - Gamelogic) for this to work. Depending on your plane index numbers differ. Bombs tend to start off at index number 2, however not always. Your best bet is to run a test mission with the above action and go through index numbers.
for "_i" from 0 to (floor(random 3)) do {
gameLogic action  ["UseWeapon",_pl2,driver _pl2,2];

_mk = createMarker ["move",(getpos _caller + (random 5000))];
_pl1 doMove (getmarkerpos _mk);
_pl2 doMove (getmarkerpos _mk);

waitUntil {_pl1 distance player > 1500 && _pl2 distance player > 1500};
{deletevehicle _x} foreach crew _pl1 + [_pl1];
{deletevehicle _x} foreach crew _pl2 + [_pl2];

This requires preplaced units, adjust passed names accordingly in execVM. Untested.

Share this post

Link to post
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in

Sign In Now
Sign in to follow this