Shakar 10 Posted March 5, 2011 Hello, I was wondering if there is a scipt where one specific unit will hunt only a specific target. For example, an A10 who hunts only Arty ignoring every thing else and either destroys ARTY or marks exact position on a map with an "X" so your Arty can take it out. Or make a Sniper go hunt enemy sniper... Air Defense hunters,etc.... Share this post Link to post Share on other sites
ffur2007slx2_5 11 Posted March 5, 2011 This is the script I wrote before, maybe you can take a reference. /*FileName: WCRffsx_fnc_70mm_SP.sqf Author: WCR Effects: This is the script which can exert A10 use rockets covering a specific area. Usage: WCR70mm = [A10,BombingArea,0.2] execVM "WCRffsx_fnc_70mm_SP.sqf" Creating Date: 9Jan 2011 Version 1.82 Current Update Date: 9Jan 2011 */ Private ["_WCRffsx_A10","_WCRffsx_BombArea","_WCRffsx_Frequency","_AmmoNum","_WCRffsx_A10G","_WCRffsx_A10GA","_WCRffsx_A10GNum","_WCRffsx_Type"]; _WCRffsx_A10=_this select 0; _WCRffsx_BombArea=_this select 1; _WCRffsx_Frequency=_this select 2; _AmmoNum=14; _WCRffsx_A10G=group _WCRffsx_A10; _WCRffsx_A10GA=units _WCRffsx_A10G; _WCRffsx_A10GNum=count _WCRffsx_A10GA; _WCRffsx_Type=typeOf _WCRffsx_A10; if ((damage _WCRffsx_A10==0) && (_WCRffsx_A10 Ammo "FFARLauncher_14">=12) && ((getpos _WCRffsx_A10 select 2)>=5) && (_WCRffsx_A10GNum==1) && (!isNull _WCRffsx_A10) && ((_WCRffsx_Type=="A10_US_EP1")||(_WCRffsx_Type=="A10"))) then { _WCRffsx_A10 setDamage 0.05; if (alive _WCRffsx_A10 && (damage _WCRffsx_A10<0.1) && (_WCRffsx_A10GNum==1) && (!isNull _WCRffsx_A10)) then { _WCRffsx_A10 disableAI "AutoTarget"; _WCRffsx_A10 disableAI "Target"; _WCRffsx_A10G setCombatMode "BLUE"; _WCRffsx_A10 flyInHeight 500; _WCRffsx_A10 setpos [(getpos _WCRffsx_BombArea select 0),(getpos _WCRffsx_BombArea select 1)-3000,(getpos _WCRffsx_A10 select 2)]; removeAllWeapons _WCRffsx_A10; sleep 0.1; while {(alive _WCRffsx_A10) && (damage _WCRffsx_A10<0.1) && (_WCRffsx_A10GNum==1) && (!isNull _WCRffsx_A10)} do { _WCRffsx_A10 move [(getpos _WCRffsx_BombArea select 0),(getpos _WCRffsx_BombArea select 1)-500,(getpos _WCRffsx_BombArea select 2)]; sleep 0.1; if (_WCRffsx_A10 distance _WCRffsx_BombArea <=2500) then { _WCRffsx_A10 flyInHeight 550; while {alive _WCRffsx_A10} do { if ((damage _WCRffsx_A10<0.1)&&(_WCRffsx_A10 distance _WCRffsx_BombArea<=1225)) then { sleep 4.75; _WCRffsx_A10 setVectorDirAndUp [[0,10,-17],[0,10,0]]; _WCRffsx_A10 move getpos _WCRffsx_BombArea; _WCRffsx_A10 flyinheight 100; sleep 0.25; _WCRffsx_A10 allowDamage false; while {_AmmoNum>0 && (alive _WCRffsx_A10) && (_WCRffsx_A10GNum==1)&&(!isNull _WCRffsx_A10)&&(damage _WCRffsx_A10<0.1)} do { Launcher="R_Hydra_HE" createVehicle [(getpos _WCRffsx_A10 select 0)-10,(getpos _WCRffsx_A10 select 1)+4.25,(getpos _WCRffsx_A10 select 2)-14]; Launcher setDir getDir _WCRffsx_A10; Launcher setVectorDirAndUp [[0,10,-11],[0,10,0]]; Launcher0="R_Hydra_HE" createVehicle [(getpos _WCRffsx_A10 select 0)+10,(getpos _WCRffsx_A10 select 1)+4.25,(getpos _WCRffsx_A10 select 2)-14]; Launcher0 setDir getDir _WCRffsx_A10; Launcher0 setVectorDirAndUp [[0,10,-11],[0,10,0]]; sleep _WCRffsx_Frequency; _AmmoNum=_AmmoNum-2; if (_AmmoNum==0 && (alive _WCRffsx_A10) && (_WCRffsx_A10GNum==1) && (!isNull _WCRffsx_A10)) exitWith { _WCRffsx_A10 enableAI "AUTOTARGET"; _WCRffsx_A10 enableAI "TARGET"; _WCRffsx_A10 setVehicleAmmo 0.5; _WCRffsx_A10G setCombatMode "RED"; sleep 0.5; _WCRffsx_A10 allowdamage true; _WCRffsx_A10 flyInHeight 350; sleep 0.5; _WCRffsx_A10 setDamage 0; WaitUntil {isNull _WCRffsx_A10}; }; }; } else { }; sleep 0.1; }; } else { }; }; } else { if (true) exitWith { sleep 0.5; _WCRffsx_A10 allowdamage true; _WCRffsx_A10 flyInHeight 350; sleep 0.5; _WCRffsx_A10 setDamage 0; }; }; } else { if (true) exitWith { hintSilent "Rockets coverage support is not available at present, there're several reasons. \n1.Maybe the plane is damaged.\n2.If you can not run the script in MP, check whether you have disabled AI.\n3.You've already called for support and it can not be used for second time because A10 is short of rockets.\n4.You can not call the support again when you've already called it.\n5.Do not group the A10 who is going to run the script, you can regroup it when it has finished its task!"; sleep 0.1; }; }; Share this post Link to post Share on other sites