Jump to content
Sign in to follow this  
ffur2007slx2_5

Force A10 use FFAR fire at a given target

Recommended Posts

Hey, guys.

I spent several days write a script which can force A10 use FFAR firing at a given target like invisible Game logic etc.

I used to use _A10 fireAtTarget [logic,"H_Hydra_40"] commend but AI pilot only firing FFAR blindly. Now I've writen two scripts for A10 and Su25, it works well, the latest version is V1.7

I just wanna to share my stupid script with you, I will feel appreciate if anyone of you can give me your time to test it. Any feedbacks or corrections are welcomed!:D

V1.7 Changelog

Final version, the script is more stable than it used to be.

A10 or Su25 won't crash down when firing rockets

Rockets droping place more accurate

v1.4 Changelog

A10 or Su25 can drop rockets to the given target more precisely when you call it through radio.

;////Let a fixed wing aircraft use S8t FFAR cover an area                                                            \\\\
;////Author: WCR_ffsx            Script Version V1.7                                                                  \\\\
;////Usage [aircraft,BombingArea,frequency between each Rockets] exec "WCRffsx_S8TCoverage.sqs"                        \\\\
;////Example: Create a fixed wing aircraft like A10, init is flying. Then use logic to locate                           \\\\
;////your bombing area. Finally, use number to fill in the third position in the arrary as launching frequency.          \\\\
;////My mailbox:ffur2007slx2_5@126.com                                                                                    \\\\
;////======================================================================================================================\\\\
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 (local player && alive player && player distance _WCRffsx_BombArea <=5500 && (damage _WCRffsx_A10==0) && (_WCRffsx_A10 Ammo "FFARLauncher_14">=12) && _WCRffsx_A10GNum==1 && (!isNull _WCRffsx_A10) && ((_WCRffsx_Type=="A10_US_EP1")||(_WCRffsx_Type=="A10"))) then {_WCRffsx_A10 setDamage 0.05; goto "Start"} else {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!";goto "Totallyexit"}
#start
if (alive _WCRffsx_A10 && (damage _WCRffsx_A10<0.1) && (_WCRffsx_A10GNum==1) && (!isNull _WCRffsx_A10)) then {goto "start0"} else {goto "exit"}
#start0
_WCRffsx_A10 disableAI "AutoTarget"
_WCRffsx_A10 disableAI "Target"
_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
~0.1
#start1
~0.1
if ((alive _WCRffsx_A10) &&(damage _WCRffsx_A10<0.1)&&(_WCRffsx_A10GNum==1)&&(!isNull _WCRffsx_A10)) then {_WCRffsx_A10 move [(getpos _WCRffsx_BombArea select 0),(getpos _WCRffsx_BombArea select 1)-500,(getpos _WCRffsx_BombArea select 2)]} else {goto "Totallyexit"}
if ((_WCRffsx_A10 distance _WCRffsx_BombArea <=2500) && (alive _WCRffsx_A10) && (damage _WCRffsx_A10<0.1) && (_WCRffsx_A10GNum==1)&&(!isNull _WCRffsx_A10)) then {goto "AngleAdjust"} else {goto "Start1"}
#AngleAdjust
_WCRffsx_A10 flyInHeight 550
#Check
?((damage _WCRffsx_A10<0.1)&&(_WCRffsx_A10 distance _WCRffsx_BombArea<=1225)):goto "Touch"
~0.1
goto "Check"
#Touch
~4.75
if (alive _WCRffsx_A10 && (damage _WCRffsx_A10<0.1) && (_WCRffsx_A10GNum==1)&&(!isNull _WCRffsx_A10)) then {_WCRffsx_A10 setVectorDirAndUp [[0,10,-17],[0,10,0]]} else {goto "Totallyexit"}
if (alive _WCRffsx_A10 && (damage _WCRffsx_A10<0.1) && (_WCRffsx_A10GNum==1)&&(!isNull _WCRffsx_A10)) then {_WCRffsx_A10 move getpos _WCRffsx_BombArea} else {goto "Totallyexit"}
if (alive _WCRffsx_A10 && (damage _WCRffsx_A10<0.1) && (_WCRffsx_A10GNum==1)&&(!isNull _WCRffsx_A10)) then {_WCRffsx_A10 flyinheight 100} else {goto "Totallyexit"}
~0.25
_WCRffsx_A10 allowDamage false
#Fire
if (alive _WCRffsx_A10 && (damage _WCRffsx_A10<0.1) && (_WCRffsx_A10GNum==1)&&(!isNull _WCRffsx_A10)) then {Launcher="R_Hydra_HE" createVehicle [(getpos _WCRffsx_A10 select 0)-10,(getpos _WCRffsx_A10 select 1)+4.25,(getpos _WCRffsx_A10 select 2)-14]} else {goto "Totallyexit"}
if (alive _WCRffsx_A10 && (damage _WCRffsx_A10<0.1) && (_WCRffsx_A10GNum==1)&&(!isNull _WCRffsx_A10)) then {Launcher setDir getDir _WCRffsx_A10} else {goto "Totallyexit"}
if (alive _WCRffsx_A10 && (damage _WCRffsx_A10<0.1) && (_WCRffsx_A10GNum==1)&&(!isNull _WCRffsx_A10)) then {Launcher setVectorDirAndUp [[0,10,-11],[0,10,0]]} else {goto "Totallyexit"}
if (alive _WCRffsx_A10 && (damage _WCRffsx_A10<0.1) && (_WCRffsx_A10GNum==1)&&(!isNull _WCRffsx_A10)) then {Launcher0="R_Hydra_HE" createVehicle [(getpos _WCRffsx_A10 select 0)+10,(getpos _WCRffsx_A10 select 1)+4.25,(getpos _WCRffsx_A10 select 2)-14]} else {goto "Totallyexit"}
if (alive _WCRffsx_A10 && (damage _WCRffsx_A10<0.1) && (_WCRffsx_A10GNum==1)&&(!isNull _WCRffsx_A10)) then {Launcher0 setDir getDir _WCRffsx_A10} else {goto "Totallyexit"}
if (alive _WCRffsx_A10 && (damage _WCRffsx_A10<0.1) && (_WCRffsx_A10GNum==1)&&(!isNull _WCRffsx_A10)) then {Launcher0 setVectorDirAndUp [[0,10,-11],[0,10,0]]} else {goto "Totallyexit"}
~_WCRffsx_Frequency
_AmmoNum=_AmmoNum-2
if (_AmmoNum>0 && (alive _WCRffsx_A10) && (_WCRffsx_A10GNum==1)&&(!isNull _WCRffsx_A10)) then {goto "Fire"} else {}
if (_AmmoNum==0 && (alive _WCRffsx_A10) && (_WCRffsx_A10GNum==1)&&(!isNull _WCRffsx_A10)) then {_WCRffsx_A10 enableAI "AUTOTARGET"; _WCRffsx_A10 enableAI "TARGET"; _WCRffsx_A10 setVehicleAmmo 0.5; goto "exit"} else {goto "TotallyExit"}
#exit
~0.5
_WCRffsx_A10 allowdamage true
_WCRffsx_A10 flyInHeight 350
~0.5
_WCRffsx_A10 setDamage 0
exit
#TotallyExit
_WCRffsx_A10 allowDamage true
exit

And this one is for Su25

;////Let a fixed wing aircraft use S8t FFAR cover an area                                                            \\\\
;////Author: WCR_ffsx            Script Version V1.7                                                                  \\\\
;////Usage [aircraft,BombingArea,frequency between each Rockets] exec "WCRffsx_S8TCoverage.sqs"                        \\\\
;////Example: Create a fixed wing aircraft like Su25, init is flying. Then use logic to locate                          \\\\
;////your bombing area. Finally, use number to fill in the third position in the arrary as launching frequency.          \\\\
;////My mailbox:ffur2007slx2_5@126.com                                                                                    \\\\
;////======================================================================================================================\\\\
Private ["_WCRffsx_Su25","_WCRffsx_BombArea","_WCRffsx_Frequency","_AmmoNum","_WCRffsx_Su25G","_WCRffsx_Su25GA","_WCRffsx_Su25GNum","_WCRffsx_Type"]
_WCRffsx_Su25=_this select 0
_WCRffsx_BombArea=_this select 1
_WCRffsx_Frequency=_this select 2
_AmmoNum=40
_WCRffsx_Su25G=group _WCRffsx_Su25
_WCRffsx_Su25GA=units _WCRffsx_Su25G
_WCRffsx_Su25GNum=count _WCRffsx_Su25GA
_WCRffsx_Type=typeOf _WCRffsx_Su25
if (local player && alive player && player distance _WCRffsx_BombArea <=5500 && (damage _WCRffsx_Su25==0) && (_WCRffsx_Su25 Ammo "S8Launcher">=40) && _WCRffsx_Su25GNum==1 && (!isNull _WCRffsx_Su25) && ((_WCRffsx_Type=="SU39")||(_WCRffsx_Type=="Su25_Ins")||(_WCRffsx_Type=="Su25_TK_EP1"))) then {_WCRffsx_Su25 setDamage 0.05; goto "Start"} else {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!";goto "Totallyexit"}
#start
if (alive _WCRffsx_Su25 && (damage _WCRffsx_Su25<0.1) && (_WCRffsx_Su25GNum==1) && (!isNull _WCRffsx_Su25)) then {goto "start0"} else {goto "exit"}
#start0
_WCRffsx_Su25 disableAI "AutoTarget"
_WCRffsx_Su25 disableAI "Target"
_WCRffsx_Su25 flyInHeight 500
_WCRffsx_Su25 setpos [(getpos _WCRffsx_BombArea select 0),(getpos _WCRffsx_BombArea select 1)-3000,(getpos _WCRffsx_Su25 select 2)]
removeAllWeapons _WCRffsx_Su25
~0.1
#start1
~0.1
if ((alive _WCRffsx_Su25) &&(damage _WCRffsx_Su25<0.1)&&(_WCRffsx_Su25GNum==1)&&(!isNull _WCRffsx_Su25)) then {_WCRffsx_Su25 move [(getpos _WCRffsx_BombArea select 0),(getpos _WCRffsx_BombArea select 1)-500,(getpos _WCRffsx_BombArea select 2)]} else {goto "Totallyexit"}
if ((_WCRffsx_Su25 distance _WCRffsx_BombArea <=2500) && (alive _WCRffsx_Su25) && (damage _WCRffsx_Su25<0.1) && (_WCRffsx_Su25GNum==1)&&(!isNull _WCRffsx_Su25)) then {goto "AngleAdjust"} else {goto "Start1"}
#AngleAdjust
_WCRffsx_Su25 flyInHeight 550
#Check
?((damage _WCRffsx_Su25<0.1)&&(_WCRffsx_Su25 distance _WCRffsx_BombArea<=1225)):goto "Touch"
~0.1
goto "Check"
#Touch
~4.5
if (alive _WCRffsx_Su25 && (damage _WCRffsx_Su25<0.1) && (_WCRffsx_Su25GNum==1)&&(!isNull _WCRffsx_Su25)) then {_WCRffsx_Su25 setVectorDirAndUp [[0,10,-17],[0,10,0]]} else {goto "Totallyexit"}
if (alive _WCRffsx_Su25 && (damage _WCRffsx_Su25<0.1) && (_WCRffsx_Su25GNum==1)&&(!isNull _WCRffsx_Su25)) then {_WCRffsx_Su25 move getpos _WCRffsx_BombArea} else {goto "Totallyexit"}
if (alive _WCRffsx_Su25 && (damage _WCRffsx_Su25<0.1) && (_WCRffsx_Su25GNum==1)&&(!isNull _WCRffsx_Su25)) then {_WCRffsx_Su25 flyinheight 100} else {goto "Totallyexit"}
~0.25
_WCRffsx_Su25 allowDamage false
#Fire
if (alive _WCRffsx_Su25 && (damage _WCRffsx_Su25<0.1) && (_WCRffsx_Su25GNum==1)&&(!isNull _WCRffsx_Su25)) then {Launcher="R_S8T_AT" createVehicle [(getpos _WCRffsx_Su25 select 0)-10,(getpos _WCRffsx_Su25 select 1)+4.25,(getpos _WCRffsx_Su25 select 2)-14]} else {goto "Totallyexit"}
if (alive _WCRffsx_Su25 && (damage _WCRffsx_Su25<0.1) && (_WCRffsx_Su25GNum==1)&&(!isNull _WCRffsx_Su25)) then {Launcher setDir getDir _WCRffsx_Su25} else {goto "Totallyexit"}
if (alive _WCRffsx_Su25 && (damage _WCRffsx_Su25<0.1) && (_WCRffsx_Su25GNum==1)&&(!isNull _WCRffsx_Su25)) then {Launcher setVectorDirAndUp [[0,10,-11],[0,10,0]]} else {goto "Totallyexit"}
if (alive _WCRffsx_Su25 && (damage _WCRffsx_Su25<0.1) && (_WCRffsx_Su25GNum==1)&&(!isNull _WCRffsx_Su25)) then {Launcher0="R_S8T_AT" createVehicle [(getpos _WCRffsx_Su25 select 0)+10,(getpos _WCRffsx_Su25 select 1)+4.25,(getpos _WCRffsx_Su25 select 2)-14]} else {goto "Totallyexit"}
if (alive _WCRffsx_Su25 && (damage _WCRffsx_Su25<0.1) && (_WCRffsx_Su25GNum==1)&&(!isNull _WCRffsx_Su25)) then {Launcher0 setDir getDir _WCRffsx_Su25} else {goto "Totallyexit"}
if (alive _WCRffsx_Su25 && (damage _WCRffsx_Su25<0.1) && (_WCRffsx_Su25GNum==1)&&(!isNull _WCRffsx_Su25)) then {Launcher0 setVectorDirAndUp [[0,10,-11],[0,10,0]]} else {goto "Totallyexit"}
~_WCRffsx_Frequency
_AmmoNum=_AmmoNum-2
if (_AmmoNum>0 && (alive _WCRffsx_Su25) && (_WCRffsx_Su25GNum==1)&&(!isNull _WCRffsx_Su25)) then {goto "Fire"} else {}
if (_AmmoNum==0 && (alive _WCRffsx_Su25) && (_WCRffsx_Su25GNum==1)&&(!isNull _WCRffsx_Su25)) then {_WCRffsx_Su25 enableAI "AUTOTARGET"; _WCRffsx_Su25 enableAI "TARGET"; _WCRffsx_Su25 setVehicleAmmo 0.5; goto "exit"} else {goto "TotallyExit"}
#exit
~0.5
_WCRffsx_Su25 allowdamage true
_WCRffsx_Su25 flyInHeight 350
~0.5
_WCRffsx_Su25 setDamage 0
exit
#TotallyExit
_WCRffsx_Su25 allowDamage true
exit

Thanks:D

Edited by ffur2007slx2_5
Updated to V1.7 for both two scripts

Share this post


Link to post
Share on other sites

perfect! I am doing an amphib landing from off the coast of Lingor and this may make the perfect opening as the players hit the beach. I had scripted some LGB on the ground with triggers that blew the LGB as two sets of Harriers flew over.

Share this post


Link to post
Share on other sites

Hi, just wanted to say that this is an amazing script, I'm thinking of using it in a mission, and I was wondering if you could answer a couple of quick questions.

Firstly, can it be altered to be used with a different aircraft with a different loadout? I'm thinking of using it with the A-1 from 'Vietnam: The Experience', a mod.

Secondly, is it possible to call in the strike, and pinpoint the location? For example, you use a radio command and then click on the map to specify the location.

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  

×