Jump to content
Sign in to follow this  
CruiseMissile

NEED HELP! How to make a plane drop a FAB-250 and more

Recommended Posts

I need help please.

I need to know how to make, say an insurgent SU-25 drop a FAB-250 bomb in a specific area, like when it reaches a waypoint it lets go of a bomb or 2?.

Also how would I make Carbomb, like a truck explode like a Fab-250 bomb, when it reaches a certain waypoint?

Help would be greatly appreciated.

Share this post


Link to post
Share on other sites

Well I've got an Airstrike script from MrMurrays Editing Guide. Should also work for Arma 2. You only have to change the plane and the pilot i think.

setfire=true;
titleText ["Click on the map to set your firedirection","plain down"];
onMapSingleClick "ASTarget setPos _pos; setfire=false";
@!setfire;
"Firedirection" setmarkerpos getPos ASTarget;
onMapSingleClick "";
titleText ["", "plain down"];
;=========DEFINE=======================
_dropPosition = getpos ASTarget;
~0.5
_dropPosX = _dropPosition select 0;
_dropPosY = _dropPosition select 1;
_dropPosZ = _dropPosition select 2;
~0.1
_planespawnpos = [_dropPosX + 3000, _dropPosY, _dropPosZ + 1000];
_pilotspawnpos = [_dropPosX + 3000, _dropPosY, _dropPosZ + 1000];
;=========CREATE=======================
_PlaneG = creategroup WEST;
_plane = createVehicle ["AV8B",_planespawnpos,[], 0, "FLY"];
_plane setPos [(getPos _plane select 0),(getPos _plane select 1),900] ;
_pilot = "SoldierWPilot" createUnit [getMarkerPos "Firedirection", _PlaneG, "P1=this"];
_Plane setVelocity [100,0,0] ;
~0.4
P1 moveinDriver _plane;
P1 setDamage 0;
P1 action ["gear_up", vehicle P1] ;
_plane flyinHeight 100;
_plane setSpeedMode "full";
#CHECK
P1 doMove getPos ASTarget;
P1 doTarget ASTarget;
P1 doWatch ASTarget;
? (_plane distance ASTarget) < 1500 : goto "DROP"
goto "CHECK"
;=========FIRE=======================
#DROP
_i = 0
_plane flyInHeight 100;
_plane setPos [(getPos _plane select 0),(getPos _plane select 1),100] ;
~13
#FIRE
_i=_i+1
_plane fire "BombLauncher";
~0.2
? _i <= 6 : goto "FIRE"
;=========FLY AWAY=======================
ASTarget setPos [0,0,0];
"Firedirection" setMarkerPos [0,0];
_plane setSpeedMode “Fullâ€
~4
_plane flyInHeight 300;
P1 doMove getPos ASTarget;
#Check2
_plane setDamage 0;
P1 setDamage 0;
? (_plane distance Player) > 2500 : goto "ENDE";
goto "Check2"
;=========DELETE========================
#ENDE;
deleteVehicle _plane;
deleteGroup _PlaneG
deleteVehicle P1;
exitWith

Note: You have to put an empty Heli-H on the map called "ASTarget", and you have to place a marker called "Firedirection". If you want the Airstrike to hit a fixed position, just delete the setfire-part and put the "ASTarget" on the position that you want to hit. Hope it works...

Share this post


Link to post
Share on other sites

I'm not really sure what I get out of this, do I just put this script in my mission and then open up the map and place where I want the airstrike or?

It's because I want it as a part of a scenario where I assault this village and I automatically get air support.

Share this post


Link to post
Share on other sites
I'm not really sure what I get out of this, do I just put this script in my mission and then open up the map and place where I want the airstrike or?

Yes, you can choose the target of the airstrike in-game on your map.

If you want to get automatically air support on a target that you don't have to choose on the map, put an empty Heli-H in the editor on the map where you want that airstrike and give it a name(let's say "x"). Then you place a trigger with the following syntax on activation:

[x] exec "airstrike.sqs"

. And then you make a script called "aristrike.sqs" with this code:

;=========DEFINE=======================
_Ziel=_this select 0;

_dropPosition = getpos _Ziel;
~0.5
_dropPosX = _dropPosition select 0;
_dropPosY = _dropPosition select 1;
_dropPosZ = _dropPosition select 2;
~0.1
_planespawnpos = [_dropPosX + 3000, _dropPosY, _dropPosZ + 1000];
_pilotspawnpos = [_dropPosX + 3000, _dropPosY, _dropPosZ + 1000];
;=========CREATE=======================
_PlaneG = creategroup WEST;
_plane = createVehicle ["AV8B",_planespawnpos,[], 0, "FLY"];
_plane setPos [(getPos _plane select 0),(getPos _plane select 1),900] ;
_pilot = "Pilot" createUnit [getMarkerPos "Firedirection", _PlaneG, "P1=this"];
_Plane setVelocity [100,0,0] ;
~0.4
P1 moveinDriver _plane;
P1 setDamage 0;
P1 action ["gear_up", vehicle P1] ;
_plane flyinHeight 100;
#CHECK
P1 doMove getPos _Ziel;
P1 doTarget _Ziel;
P1 doWatch _Ziel;
? (_plane distance _Ziel) < 1500 : goto "DROP"
goto "CHECK"
;=========FIRE=======================
#DROP
_i = 0
_plane flyInHeight 100;
_plane setPos [(getPos _plane select 0),(getPos _plane select 1),100] ;
~13
#FIRE
_i=_i+1
_plane fire "BombLauncher";
~0.2
? _i <= 6 : goto "FIRE"
;=========FLY AWAY=======================
_Ziel setPos [0,0,0];
"Firedirection" setMarkerPos [0,0];
~4
_plane flyInHeight 300;
P1 doMove getPos _Ziel;
#Check2
_plane setDamage 0;
P1 setDamage 0;
? (_plane distance Player) > 2500 : goto "ENDE";
goto "Check2"
;=========DELETE========================
#ENDE;
deleteVehicle _plane;
deleteGroup _PlaneG
deleteVehicle P1;
exit

Now, if the trigger is activated, an airstrike should hit at x's position.

Share this post


Link to post
Share on other sites
Yes, you can choose the target of the airstrike in-game on your map.

If you want to get automatically air support on a target that you don't have to choose on the map, put an empty Heli-H in the editor on the map where you want that airstrike and give it a name(let's say "x"). Then you place a trigger with the following syntax on activation:

[x] exec "airstrike.sqs"

. And then you make a script called "aristrike.sqs" with this code:

;=========DEFINE=======================
_Ziel=_this select 0;

_dropPosition = getpos _Ziel;
~0.5
_dropPosX = _dropPosition select 0;
_dropPosY = _dropPosition select 1;
_dropPosZ = _dropPosition select 2;
~0.1
_planespawnpos = [_dropPosX + 3000, _dropPosY, _dropPosZ + 1000];
_pilotspawnpos = [_dropPosX + 3000, _dropPosY, _dropPosZ + 1000];
;=========CREATE=======================
_PlaneG = creategroup WEST;
_plane = createVehicle ["AV8B",_planespawnpos,[], 0, "FLY"];
_plane setPos [(getPos _plane select 0),(getPos _plane select 1),900] ;
_pilot = "Pilot" createUnit [getMarkerPos "Firedirection", _PlaneG, "P1=this"];
_Plane setVelocity [100,0,0] ;
~0.4
P1 moveinDriver _plane;
P1 setDamage 0;
P1 action ["gear_up", vehicle P1] ;
_plane flyinHeight 100;
#CHECK
P1 doMove getPos _Ziel;
P1 doTarget _Ziel;
P1 doWatch _Ziel;
? (_plane distance _Ziel) < 1500 : goto "DROP"
goto "CHECK"
;=========FIRE=======================
#DROP
_i = 0
_plane flyInHeight 100;
_plane setPos [(getPos _plane select 0),(getPos _plane select 1),100] ;
~13
#FIRE
_i=_i+1
_plane fire "BombLauncher";
~0.2
? _i <= 6 : goto "FIRE"
;=========FLY AWAY=======================
_Ziel setPos [0,0,0];
"Firedirection" setMarkerPos [0,0];
~4
_plane flyInHeight 300;
P1 doMove getPos _Ziel;
#Check2
_plane setDamage 0;
P1 setDamage 0;
? (_plane distance Player) > 2500 : goto "ENDE";
goto "Check2"
;=========DELETE========================
#ENDE;
deleteVehicle _plane;
deleteGroup _PlaneG
deleteVehicle P1;
exit

Now, if the trigger is activated, an airstrike should hit at x's position.

Nice work. I'd like to change the plane from Harrier to SU25 or SU 34. It works nearly. But the SU doesnt drop any bombs. It only flys over the target :confused:

Could you help ?

THX illu

Share this post


Link to post
Share on other sites

Sorry, i didn't write this script - it's from MrMurrays Editing Guide. I just changed a few things for my missions.

Well, i think your problem is, that the SU-25/34 has no bombs. Only the AV8B has some... But it makes no difference who dropped the Bombs - so you can use the Harrier as well. I think, it's flying so fast, you can't regocnize if it's a BLUFOR or an OPFOR plane. ;)

Edited by IndeedPete

Share this post


Link to post
Share on other sites
Sorry, i didn't write this script - it's from MrMurrays Editing Guide. I just changed a few things for my missions.

Well, i think your problem is, that the SU-25/34 has no bombs. Only the AV8B has some... But it makes no difference who dropped the Bombs - so you can use the Harrier as well. I think, it's flying so fast, you can't regocnize if it's a BLUFOR or an OPFOR plane. ;)

Yeah, you are right, SU doesnt have LGB bombs. But the Mi24.P chooper has two FAB-250 bomb. The problem here: The script genrates just a pilot, and the Mi has a pilot and a gunner. so yo also need a gunner to drop these FAB-250 bombs... :rolleyes:

Share this post


Link to post
Share on other sites

I've got not much time now but I think this should work. Add the follwing code to the "Create" area:

_pilot2 = "Pilot" createUnit [getMarkerPos "Firedirection", _PlaneG, "P2=this"];
P2 moveinGunner _plane;
P2 setDamage 0;
P2 action ["gear_up", vehicle P2] ;

Then you have to change this in the "Check"-loop:

P2 doTarget _Ziel;
P2 doWatch _Ziel;

And then at "Fly Away" add:

P2 setDamage 0;

Now add

deleteVehicle P2

at "Delete". Well, i hope i forgot nothing...:)

Share this post


Link to post
Share on other sites

Hi IndeedPete, sorry but your stuff with the gunner doesnt work.

Ok, i modified the script like this, to get this script running with a SU25..

;=========DEFINE=======================
_Ziel=_this select 0;

_dropPosition = getpos _Ziel;
~0.5
_dropPosX = _dropPosition select 0;
_dropPosY = _dropPosition select 1;
_dropPosZ = _dropPosition select 2;
~0.1
_planespawnpos = [_dropPosX + 3000, _dropPosY, _dropPosZ + 1000];
_pilotspawnpos = [_dropPosX + 3000, _dropPosY, _dropPosZ + 1000];
;=========CREATE=======================
_PlaneG = creategroup EAST;
_plane = createVehicle [[b]"Su25_Ins[/b]",_planespawnpos,[], 0, "FLY"];
_plane setPos [(getPos _plane select 0),(getPos _plane select 1),900] ;
_pilot = "Pilot" createUnit [getMarkerPos "Firedirection2", _PlaneG, "P2=this"];
_Plane setVelocity [100,0,0] ;
~0.4
P2 moveinDriver _plane;
P2 setDamage 0;
P2 action ["gear_up", vehicle P2] ;
_plane flyinHeight 100;
#CHECK
P2 doMove getPos _Ziel;
P2 doTarget _Ziel;
P2 doWatch _Ziel;
? (_plane distance _Ziel) < 1500 : goto "DROP"
goto "CHECK"
;=========FIRE=======================
#DROP
_i = 0
_plane flyInHeight 100;
_plane setPos [(getPos _plane select 0),(getPos _plane select 1),100] ;
~13
#FIRE
_i=_i+1
_plane fire "[b]AirBombLauncher[/b]";
~0.2
? _i <= 6 : goto "FIRE"
;=========FLY AWAY=======================
_Ziel setPos [0,0,0];
"Firedirection2" setMarkerPos [0,0];
~4
_plane flyInHeight 300;
P2 doMove getPos _Ziel;
#Check2
_plane setDamage 0;
P2 setDamage 0;
? (_plane distance Player) > 2500 : goto "ENDE";
goto "Check2"
;=========DELETE========================
#ENDE;
deleteVehicle _plane;
deleteGroup _PlaneG
deleteVehicle P2;
exit

The Su25_Ins has 4 FAB bombs (see here). I also changed the _plane fire classname, based on http://community.bistudio.com/wiki/Worldeater%27s_Sandbox, which is AirBombLauncher for the SU. But the SU dont drop any bombs :confused:

Do you have an idea ?

Share this post


Link to post
Share on other sites

Hm, the SU-25 has no gunner...

Well, i've tried it several times and made a new script, but it doesn't work.:mad: Maybe there's something wrong with the weapon name? Or it's just a bug...:confused:

Share this post


Link to post
Share on other sites
Maybe there's something wrong with the weapon name? Or it's just a bug...:confused:
This only could be the reason. The class name for weapon or just a bug. :(

I got the weapon class name from two different sites (ArmA WiKi and a ArmA Editing website).

A temporary solution looks a bit crazy, if the Harrier flys a airstrike for the russian party.

Share this post


Link to post
Share on other sites

Where do you save the .sqs file. I've looked around on the internet and read that the file needs to go in the specific mission folder, but whenever I test the mission it keeps saying can't find the airstrike.sqs script. What am I doing wrong?

Share this post


Link to post
Share on other sites

Place the "airstrike.sqs" in your mission folder: MyDocuments\ArmA2 Other Profiles\YourNick\missions\YourMission

Share this post


Link to post
Share on other sites
Yes, you can choose the target of the airstrike in-game on your map.

If you want to get automatically air support on a target that you don't have to choose on the map, put an empty Heli-H in the editor on the map where you want that airstrike and give it a name(let's say "x"). Then you place a trigger with the following syntax on activation:

[x] exec "airstrike.sqs"

. And then you make a script called "aristrike.sqs" with this code:

;=========DEFINE=======================
_Ziel=_this select 0;

_dropPosition = getpos _Ziel;
~0.5
_dropPosX = _dropPosition select 0;
_dropPosY = _dropPosition select 1;
_dropPosZ = _dropPosition select 2;
~0.1
_planespawnpos = [_dropPosX + 3000, _dropPosY, _dropPosZ + 1000];
_pilotspawnpos = [_dropPosX + 3000, _dropPosY, _dropPosZ + 1000];
;=========CREATE=======================
_PlaneG = creategroup WEST;
_plane = createVehicle ["AV8B",_planespawnpos,[], 0, "FLY"];
_plane setPos [(getPos _plane select 0),(getPos _plane select 1),900] ;
_pilot = "Pilot" createUnit [getMarkerPos "Firedirection", _PlaneG, "P1=this"];
_Plane setVelocity [100,0,0] ;
~0.4
P1 moveinDriver _plane;
P1 setDamage 0;
P1 action ["gear_up", vehicle P1] ;
_plane flyinHeight 100;
#CHECK
P1 doMove getPos _Ziel;
P1 doTarget _Ziel;
P1 doWatch _Ziel;
? (_plane distance _Ziel) < 1500 : goto "DROP"
goto "CHECK"
;=========FIRE=======================
#DROP
_i = 0
_plane flyInHeight 100;
_plane setPos [(getPos _plane select 0),(getPos _plane select 1),100] ;
~13
#FIRE
_i=_i+1
_plane fire "BombLauncher";
~0.2
? _i <= 6 : goto "FIRE"
;=========FLY AWAY=======================
_Ziel setPos [0,0,0];
"Firedirection" setMarkerPos [0,0];
~4
_plane flyInHeight 300;
P1 doMove getPos _Ziel;
#Check2
_plane setDamage 0;
P1 setDamage 0;
? (_plane distance Player) > 2500 : goto "ENDE";
goto "Check2"
;=========DELETE========================
#ENDE;
deleteVehicle _plane;
deleteGroup _PlaneG
deleteVehicle P1;
exit

Now, if the trigger is activated, an airstrike should hit at x's position.

This does not seem to work for me, I have placed a marker on the target and named it "x", i have copy/pasted that exact script and placed it in my missions folder. I have also created a trigger with the above command however nothing seems to happen?

Share this post


Link to post
Share on other sites

Ok, to make this script work I

1) placed an empty marker called "Firedirection" anywhere on the map

2) placed an invisible Heli-H called "x" on the target's position

3) placed a trigger with onAct

[x] exec "airstrike.sqs"

4) used the following script called "airstrike.sqs"

;=========DEFINE=======================
_Ziel=_this select 0;
"Firedirection" setmarkerpos getPos _Ziel;

_dropPosition = getpos _Ziel;
~0.5
_dropPosX = _dropPosition select 0;
_dropPosY = _dropPosition select 1;
_dropPosZ = _dropPosition select 2;
~0.1
_planespawnpos = [_dropPosX + 3000, _dropPosY, _dropPosZ + 1000];
_pilotspawnpos = [_dropPosX + 3000, _dropPosY, _dropPosZ + 1000];
;=========CREATE=======================
_PlaneG = creategroup WEST;
_plane = createVehicle ["AV8B",_planespawnpos,[], 0, "FLY"];
_plane setPos [(getPos _plane select 0),(getPos _plane select 1),900] ;
_pilot = "Pilot" createUnit [getMarkerPos "Firedirection", _PlaneG, "P1=this"];
_Plane setVelocity [100,0,0] ;
~0.4
P1 moveinDriver _plane;
P1 setDamage 0;
P1 action ["gear_up", vehicle P1] ;
_plane flyinHeight 100;
#CHECK
P1 doMove getPos _Ziel;
P1 doTarget _Ziel;
P1 doWatch _Ziel;
? (_plane distance _Ziel) < 1500 : goto "DROP"
goto "CHECK"
;=========FIRE=======================
#DROP
_i = 0
_plane flyInHeight 100;
_plane setPos [(getPos _plane select 0),(getPos _plane select 1),100] ;
~13
#FIRE
_i=_i+1
_plane fire "BombLauncher";
~0.2
? _i <= 6 : goto "FIRE"
;=========FLY AWAY=======================
_Ziel setPos [0,0,0];
"Firedirection" setMarkerPos [0,0];
~4
_plane flyInHeight 300;
P1 doMove getPos _Ziel;
#Check2
_plane setDamage 0;
P1 setDamage 0;
? (_plane distance _Ziel) > 2500 : goto "ENDE";
goto "Check2"
;=========DELETE========================
#ENDE;
deleteVehicle _plane;
deleteGroup _PlaneG
deleteVehicle P1;
exit

;)

Share this post


Link to post
Share on other sites

It works fine but...

The Plane flights high when you first see it...then i jumps near to the ground and gets higher again and drops the bombs.

This jumping looks very...crazy ;)

Is there any way the plane flights smooth in one high ?

Share this post


Link to post
Share on other sites

is there a way how i can set the ingress direction of the aircraft. Cause i have a target in between 2 mountain's but when i put the x marker there it keeps comming from the side instead of inbetween the mountains.

Can somebody show how you can implement that in the script.

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  

×