You can adapt this for a guaranteed hit (choose angles carefully or the rocket will track) : http://www.kylania.com/ex/?p=21
Swap the laser target for the helicopter, change ammo type to rpg and set launch position to the AI, I adapted it for an A10 to drop a laser guided bomb from a higher speed an altitude rather than the standard kamikazi, bomb run of certain death, but it will work for a range of situations:
To see the ammo in action put this in a radio trigger:
Code:
rkt = "R_PG7VL_AT" createVehicle getpos player; rkt setpos [ getPos player select 0, getPos player select 1, +2]
If you give me a few hours I will do an example mission as I would find this useful too (no laserTarget).
If you use kylania's script without change, you will need laser target.
Alternative - no lasertarget but not 100% guaranteed hit.
OK it's done. It spawns a target object and attaches it to the tail rotor gear box of an UH60M. This script will produce a direct hit on the tailrotor of the UH60M and send it into a spin / crash landing. An RPG rocket is fired from the AI position and makes a guaranteed hit on target object. Have a look at the target type - you may need to change it depending on game version A2/OA. It should look realistic for any AA/AT soldier.
You need a named soldier and target helicopter on the map for it to work.
Example missions here, Utes and Desert: http://www.mediafire.com/?5b3dqk9pt11y1uq
_RPGguy = _this select 0; //AT/AA man who will fire missile missile
_missileType = _this select 1; //type of the missile
_missileSpeed = _this select 2; //speed of the missile
_targetHeli = _this select 3;
_primaryTarget = "Land_Bucket_EP1" createVehicle (getPos _targetHeli); //target for the missile, A2 use: "Baseball" ,or OA use: "Land_Bucket_EP1"
_primaryTarget attachTo [ch1, [0, -8, 0.8]];//for UH60M change for other helicopter type [x,y,z]
waituntil {!isnil "bis_fnc_init"};
_defaultTargetPos = getposATL _primaryTarget; //default position where unguided missiles will fly [8340.718750,3074.914795,0];
if (isNull _primarytarget) exitWith {hintSilent "No Target Found!, change script for A2 or OA"};
doStop _RPGguy;
_RPGguy setUnitPos "up";
_pWeap = primaryWeapon _RPGguy;
_RPGguy removeWeapon _pWeap;
_sWeap = secondaryWeapon _RPGguy;
_RPGguy selectWeapon _sWeap;
_RPGguy doTarget _targetHeli;
sleep 7;//optional, remove for instant effect
_perSecondChecks = 25; //direction checks per second
_getPrimaryTarget = {if (typeName _primaryTarget == typename {}) then {call _primaryTarget} else {_primaryTarget}}; //code can be used for laser dots
_target = call _getPrimaryTarget;
//secondary target used for random trajectory when laser designator is turned off prematurily
_secondaryTarget = "HeliHEmpty" createVehicle _defaultTargetPos;
_secondaryTarget setPos _defaultTargetPos;
_guidedRandomly = FALSE;
//procedure for guiding the missile
_homeMissile = {
//here we switch to secondary target at random position if the laser dot no longer exists
//if the designator is turned on again, the missile will return to it's original target (providing it hadn't flown too far)
private ["_velocityX", "_velocityY", "_velocityZ", "_target"];
_target = _secondaryTarget;
if (!(_guidedRandomly) && _missile distance _target > _missileSpeed * 1.5) then {
_guidedRandomly = TRUE;
_target = _secondaryTarget;
_dispersion = (_missile distance _defaultTargetPos) / 20;
_dispersionMin = _dispersion / 10;
_target setPos [(_defaultTargetPos select 0) + _dispersionMin - (_dispersion / 2) + random _dispersion, (_defaultTargetPos select 1) + _dispersionMin - (_dispersion / 2) + random _dispersion, 0];
};
if (!(isNull (call _getPrimaryTarget))) then {_target = call _getPrimaryTarget; _defaultTargetPos = position _target; _guidedRandomly = FALSE};
//altering the direction, pitch and trajectory of the missile
if (_missile distance _target > (_missileSpeed / 20)) then {
_travelTime = (_target distance _missile) / _missileSpeed;
_steps = floor (_travelTime * _perSecondChecks);
You need to change the position of the target when using different helicopters, I can see it floating above the tail of the helicopter:
change the lines to this - if using A2/chernarus you can use the baseball which is even smaller than the bucket I use for OA.
_primaryTarget = "Baseball" createVehicle (getPos _targetHeli); //target for the missile, A2 use: "Baseball" ,or OA use: "Land_Bucket_EP1"
_primaryTarget attachTo [_targetHeli, [0, -9.7, 0]];//changed this for Mi-17 - target is hidden in tail