Jump to content
Sign in to follow this  
seriousxD

Spawning Missile midair to hit a helicopter

Recommended Posts

I am working on a mission where a helicopter comes to extract my team, but gets shot down as it comes in. How can I spawn a missile midair and get it to hit the helicopter? Also when I am placing multiple way points for my team, it just says wait. And it never shows the next one. How do I make it display the next way point?

Share this post


Link to post
Share on other sites

You'll have to create a unit with a Stinger for that to work, since creating a missile mid-air and getting it to fly towards the helo isn't possible (atleast that's what I know of, I've tested it with 3 unguided and 2 guided missiles, they just fall straight to the ground even if spawned in the air).

RU_Soldier_AA could be used for that, and take a look at createUnit array.

Share this post


Link to post
Share on other sites

What you could do is a doTarget doFire type thing (Sorry I'm bad with syntax) and find a way to get rid of the missile fire-er after firing (Probably teleport underground and kill via setDammage)

Share this post


Link to post
Share on other sites

Got a script you can put in a waypoint init.

-Spawns missile

-Creates explosion, fire, smoke

-Tail rotor / engine failure and crew exit.

-Helicopter explodes after crew clear

- Requires functions module on map

Example mission: HeliCrash2.Shapur_BAF.zip

https://dl.dropbox.com/u/37698503/HeliCrash2.Shapur_BAF.zip

nul = [(vehicle this)] execVM "crash.sqf"; //in helicopter waypoint init

//nul = [(vehicle this)] execVM "crash.sqf"
//in helicopter waypoint init

waitUntil {!isNil "bis_fnc_init"};
_heli = _this select 0;
 _list = assignedCargo _heli;
   _ldr = leader (group (_list select 1));
     _crew = crew _heli;

_heli land "LAND";

_mpos = getMarkerPos "msl";
 _hpos = getPosATL _heli;
   _dir = [_mpos, _hpos] call BIS_fnc_dirTo;

_missile = "M_Igla_AA" createVehicle _mpos;
 _missile setPos [getMarkerPos "msl" select 0, getMarkerPos "msl" select 1, (getMarkerPos "msl" select 2)+3];
   _missile setDir _dir;

//Change the middle value below to get missile trajectory (pitch) correct, missile must pass close to helicopter:
//[object, pitch, bank] call BIS_fnc_setPitchBank;
[_missile, 8, 0] call BIS_fnc_setPitchBank;

waitUntil {(_missile distance _heli) <=20};
 deleteVehicle _missile;

//fire and explosion
[_heli,4.0,120,false,false] spawn BIS_Effects_Burn;
_b = getPosATL _heli;
  _w = createVehicle ["Sh_125_HE", _b, [], 0, "CAN_COLLIDE"];
    _h = createVehicle ["weaponHolder", _b, [], 0, "CAN_COLLIDE"];
      _w setPosATL (getPosATL _h);

//crash tail rotor failure
waitUntil {(getpos _heli select 2) <=30};
 _heli setHit ["mala vrtule", 1];
   _heli setFuel 0;

waitUntil {(getpos _heli select 2) <=0.5};
 {unassignvehicle _x; dogetout _x} foreach _list;
   {[_x] joinSilent (group _ldr)} foreach _crew;
     hint "Run! It's going to explode!";

waitUntil {(_ldr distance _heli) >=60};
 _heli setDammage 1;

Share this post


Link to post
Share on other sites

"BIS_fnc_Init" is still true in A3 after functions compile, so yeah should work, but classnames would have to be changed to whatever the A3 proxies are.

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  

×