Jump to content
Sign in to follow this  
KrisSerbia

RPG man fire on Blackhawk

Recommended Posts

I want to make mission where RPG man has fire on Blackhawk and hit it.How can I make to he fire on Blackhawk and hit it with only 1 rocket?:confused:

SORRY FOR BAD ENGLISH

Share this post


Link to post
Share on other sites

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:

rkt = "R_PG7VL_AT" createVehicle getpos player; rkt setpos [ getPos player select 0, getPos player select 1, +2] 

Info to help you:

http://browser.six-projects.net/cfg_magazines/PG7VL/config?version=58

http://browser.six-projects.net/cfg_ammo/R_PG7V_AT/config?version=58

http://forums.bistudio.com/showthread.php?117064-Looking-for-Helicopter-crash-script

http://forums.bistudio.com/showthread.php?122250-How-to-Simulate-AA-hit&p=1981309&highlight=blackhawk#post1981309

http://forums.bistudio.com/showthread.php?94143-Scripting-Tail-Rotor-Fail/page2

http://forums.bistudio.com/showthread.php?107732-Ammo-exploeding-in-air&p=1753124&highlight=helicopter+damage#post1753124

http://forums.bistudio.com/showthread.php?111875-Parts-of-the-helicopter-damage-control&p=1815576&highlight=helicopter+damage#post1815576

http://forums.bistudio.com/showthread.php?105673-Helicopter-Destruction-Help

alternative:

This works if the helicopter speed is limited, distance is <100m, unit skill is high and flightpath is over AT unit.

doStop unitName;
unitName setUnitPos "up";
unitName removeWeapon "AK_107_Kobra"; //whatever primary weapon is
unitName selectWeapon "RPG7V";
unitName dotarget heliName;
sleep 5;
gameLogicName action ["useWeapon", vehicle unitName, unitName, 0];

Edited by PELHAM

Share this post


Link to post
Share on other sites

Thanks man that's realy good.Im serbian and i dont't understand that I need here to laser traget for rpg hit or rpg men will use his rpg or both?

SORRY FOR BAD ENGLISH

Share this post


Link to post
Share on other sites

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.

Share this post


Link to post
Share on other sites
Im serbian..

Not only english people can speak/understand english language... the whole world speaks english... expected serbian?

;o)

Share this post


Link to post
Share on other sites

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

guidedRPG.sqf

//nul=[nameATunit,"R_PG7V_AT",200,nameTargetHeli] execvm "scriptName.sqf"

//example: nul=[man1,"R_PG7V_AT",200,ch1] execvm "guidedRPG.sqf"

_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;

_missileStart = getPosATL _RPGguy;

_missile = _missileType createVehicle _missileStart;

_missile setPos [getPosATL _RPGguy select 0, (getPosATL _RPGguy select 1)-1.5, +2];

//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);

_relDirHor = [_missile, _target] call BIS_fnc_DirTo;

_missile setDir _relDirHor;

_relDirVer = asin ((((getPosASL _missile) select 2) - ((getPosASL _target) select 2)) / (_target distance _missile));

_relDirVer = (_relDirVer * -1);

[_missile, _relDirVer, 0] call BIS_fnc_setPitchBank;

_velocityX = (((getPosASL _target) select 0) - ((getPosASL _missile) select 0)) / _travelTime;

_velocityY = (((getPosASL _target) select 1) - ((getPosASL _missile) select 1)) / _travelTime;

_velocityZ = (((getPosASL _target) select 2) - ((getPosASL _missile) select 2)) / _travelTime;

//_defaultTargetPos = position _target;

};

[_velocityX, _velocityY, _velocityZ]

};

call _homeMissile;

//missile flying

while {alive _missile} do {

_velocityForCheck = call _homeMissile;

if ({(typeName _x) == (typeName 0)} count _velocityForCheck == 3) then {_missile setVelocity _velocityForCheck};

sleep (1 / _perSecondChecks)

};

//reset shooter

_RPGguy doWatch objNull;

_RPGguy setUnitPos "AUTO";

_RPGguy addWeapon _pWeap;

_RPGguy selectWeapon _pWeap;

//smoke effect params: [unit,intensity,time,lifecheck,fade]

_smoke =[_primaryTarget,1,time,false,true] spawn BIS_Effects_Burn;

//crash helo

sleep 5;

_targetHeli setFuel 0;

waituntil {!alive _targetHeli};

deleteVehicle _primaryTarget;

Edited by PELHAM
added smoke effect on tail

Share this post


Link to post
Share on other sites

Thanks man you are god!!!Can you teach me how can I be good scripter?Please :o

Not only english people can speak/understand english language... the whole world speaks english... expected serbian?

;o)

@Buliwyt

We have one of hardest gramar :p Try to speak serbian and you will see! :p

Edited by KrisSerbia

Share this post


Link to post
Share on other sites

Not God lol just made some changes to a script - the clever stuff was done by someone else.

Share this post


Link to post
Share on other sites

This is the little mision what i made.Sorry for bad resolution.I don't know what is with FRAPS.:confused:

Share this post


Link to post
Share on other sites

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

Share this post


Link to post
Share on other sites

hmm whats the use for the module [function]? i gave my blackhawk a bunch of waypoints including a cycle before it get hits by the rpg, but the only problem is that the heli doesn't follow the final waypoint before blowing up and instead heads to the module?

anyone know whats the problem?

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  

×