Jump to content
Sign in to follow this  
NGagedFX

Clusterbomb script

Recommended Posts

I would love for A-10 pilots in my mission to have the ability to exchange the standard GBUs for AT and AP CBUs to add some variation and destructive power. I've found 2 scripts on the internet, but they seem way too complicated and I don't get a thing about what's going on, or they are released as a mod PBO which I can't use in my mission. So I started off making my own script, and learn about it in the process. But I simply can't get it to work, even by trying 5 different ways.

This is what I came up with for an AP CBU:

A-10's (no name) init (which drops the bomb immediatly so I can spectate from the ground)

nul=[this] execVM "CBU\clusterCBU87.sqf";

clusterCBU87.sqf

_plane = _this select 0;
_subammo = "B_30mm_HE";
_value = random 20;

_bomb = "Bo_Mk82" createvehicle [2000,2000,2000];
_bomb attachTo [_plane,[0,0,-1]];
sleep 0.3;
detach _bomb;
waitUntil {(getPos _bomb select 2) = 80)};

_blet1 = _subammo createVehicle (getPos _bomb);
_blet1 setVelocity [_value,_value,((_value)-40)];
_blet2 = _subammo createVehicle (getPos _bomb);
_blet2 setVelocity [_value,_value,((_value)-40)];
_blet3 = _subammo createVehicle (getPos _bomb);
_blet3 setVelocity [_value,_value,((_value)-40)];
_blet4 = _subammo createVehicle (getPos _bomb);
_blet4 setVelocity [_value,_value,((_value)-40)];

deleteVehicle _bomb;
hint "End of script";

Ofcourse, when I get this to work there will be far more 'blets'.

Other things I got on my mind are:

-Not activated through the action menu, but as a normal weapon*

-MK82 should be dumb, as CBUs are already defastating enough

-Smoke/sound effect when detoning _bomb into submunition

-An AT version with possibly "B_25mm_APDS", "B_30mm_AP" or "B_30mmA10_AP" _subammo to destroy/disable/damage light/medium/heavy armor

-The ability to exchange a single GBU for a single AT or AP CBU

*For this, I though it would be best to use the removeMagazine/(addWeapon)/addMagazine commands on the A-10 to simply replace the GBUs by MK82 which would work as if you were flyinh an AV-8, but I don't know if it possible, when one of the bombs drops, to detect it, give it name, and assign it to _bomb in this script

---------- Post added at 15:52 ---------- Previous post was at 15:40 ----------

Just to be a bit more specific:

_subammo doesn't work, replacing it with "B_30mm_HE" does

waitUntil doesn't work, until now I've been testing it with a sleep delay

_value is indeed random, but is constant for every blet, whereas I want it to be random for every blet

However, [(random 20),(random 20),((random 20)-40)]; doesn't do anything :confused:

Edited by NGagedFX

Share this post


Link to post
Share on other sites

The waitUntil, change from = 80 to == 80, its a comparison you need, not assignment :) sorry I don't have more to offer at moment.

Share this post


Link to post
Share on other sites

Here is my attempt - well it's actually working out pretty good.

To be done:

- Add a check if it's the "clusterbomb" launched cause right now it will do it for ANY weapon including pistols etc. :D Just fix that if you have time.

- How to :

put an A10 in put this in it's init

init of a10

this addEventHandler ["fired", {[_this select 6] execVM "debug.sqf"}];

Create a debug.sqf

debug.sqf

projectPos = _this select 0;

subammo = "ARTY_Sh_82_HE";

clusterbombs = 20;

clusterheight = 30;

height = 100;

done = false;

while {!done} do

{

if(height < clusterheight) then

{

while {clusterbombs != 0} do

{

if(clusterbombs != 1)

then

{

_value = random 20;

string = format ["Cluster%1",clusterbombs];

string = subammo createVehicle (getPosATL projectPos);

_value = random 150;

string setPosATL [ (getPosATL projectPos select 0) + _value, (getPosATL projectPos select 1) - _value, getPosATL projectPos select 2];

clusterbombs = clusterbombs - 1;

}

else

{

_value = random 20;

string = format ["Cluster%1",clusterbombs];

string = subammo createVehicle (getPosATL projectPos);

_value = random 150;

string setPosATL [ (getPosATL projectPos select 0) + _value, (getPosATL projectPos select 1) - _value, getPosATL projectPos select 2];

clusterbombs = clusterbombs - 1;

done = true;

hint "Done";

};

};

}

else

{height = getPosATL projectPos select 2; hint format ["%1", height]; sleep 0.1;};

};

Also I wrote a camera script for watching the explosion but it's not as good :D Just watch it from above that it much cooler.

variable explinations

subammo = "ARTY_Sh_82_HE"; // Subammo type I am using artillery shells unrealistic but good for debuging as they make a BIG boom

clusterbombs = 20; // Ammount of bombs ropped

clusterheight = 30; // Height in which the bombs are created

height = 100; // Just don't change this number it is just cause I was to lazy to script it better - if you read through it you will see why.

Share this post


Link to post
Share on other sites

Wow that's a lot of scripting right there. :p I immediatly checked it out, but it only displayed "any" when firing a gun, and when I crashed I was unable to get back in the editor. :confused: Neither can I find where it's going wrong. Didn't you forget to ctrl+c ctrl+v something?

I've been bussy too, and this is what I came up with so far:

A-10 named CBUBomber - Init:

drop_cbu = this addAction ["Drop CBU", "CBU\AP_CBU.sqf"]

AP_CBU.sqf:

_bomb = "Bo_Mk82" createvehicle [2000,2000,2000];
_bomb attachTo [CBUBomber,[0,0,-1]];
sleep 0.5;
detach _bomb;
waitUntil {((getPos _bomb select 2) < 70)};\\Thanks to AZCoder :P

_submun1 = "B_30mm_HE" createVehicle (getPos _bomb);
_submun1 setVelocity [30,30,-10];
_submun2 = "B_30mm_HE" createVehicle (getPos _bomb);
_submun2 setVelocity [-30,30,-10];
_submun3 = "B_30mm_HE" createVehicle (getPos _bomb);
_submun3 setVelocity [30,-30,-10];
_submun4 = "B_30mm_HE" createVehicle (getPos _bomb);
_submun4 setVelocity [-30,-30,-10];
deleteVehicle _bomb;
sleep 0.5;

_bomblet1 = "B_30mm_HE" createVehicle (getpos _submun1);   
_bomblet1 setVelocity [1,0,-6];
_bomblet2 = "B_30mm_HE" createVehicle (getpos _submun1);   
_bomblet2 setVelocity [-1,0,-6];
_bomblet3 = "B_30mm_HE" createVehicle (getpos _submun1);   
_bomblet3 setVelocity [0,1,-6]; 
_bomblet4 = "B_30mm_HE" createVehicle (getpos _submun1);   
_bomblet4 setVelocity [0,-1,-6]; 
_bomblet5 = "B_30mm_HE" createVehicle (getpos _submun1);   
_bomblet5 setVelocity [0,1,-6]; 
_bomblet6 = "B_30mm_HE" createVehicle (getpos _submun1);   
_bomblet6 setVelocity [4,0,-6]; 
_bomblet7 = "B_30mm_HE" createVehicle (getpos _submun1);   
_bomblet7 setVelocity [-4,0,-6]; 
_bomblet8 = "B_30mm_HE" createVehicle (getpos _submun1);   
_bomblet8 setVelocity [0,4,-6]; 
_bomblet9 = "B_30mm_HE" createVehicle (getpos _submun1);   
_bomblet9 setVelocity [0,-4,-6]; 
_bomblet10 = "B_30mm_HE" createVehicle (getpos _submun1);   
_bomblet10 setVelocity [4,4,-6]; 
_bomblet11 = "B_30mm_HE" createVehicle (getpos _submun1);   
_bomblet11 setVelocity [-4,4,-6]; 
_bomblet12 = "B_30mm_HE" createVehicle (getpos _submun1);   
_bomblet12 setVelocity [4,-4,-6]; 
_bomblet13 = "B_30mm_HE" createVehicle (getpos _submun1);   
_bomblet13 setVelocity [-4,-4,-6]; 
_bomblet14 = "B_30mm_HE" createVehicle (getpos _submun1);   
_bomblet14 setVelocity [6,6,-6]; 
_bomblet15 = "B_30mm_HE" createVehicle (getpos _submun1);   
_bomblet15 setVelocity [-6,6,-6]; 
_bomblet16 = "B_30mm_HE" createVehicle (getpos _submun1);   
_bomblet16 setVelocity [6,-6,-6]; 
_bomblet17 = "B_30mm_HE" createVehicle (getpos _submun1);   
_bomblet17 setVelocity [-6,-6,-6]; 
_bomblet18 = "B_30mm_HE" createVehicle (getpos _submun1);   
_bomblet18 setVelocity [8,8,-6]; 
_bomblet19 = "B_30mm_HE" createVehicle (getpos _submun1);   
_bomblet19 setVelocity [-8,8,-6]; 
_bomblet20 = "B_30mm_HE" createVehicle (getpos _submun1);   
_bomblet20 setVelocity [8,-8,-6]; 
_bomblet21 = "B_30mm_HE" createVehicle (getpos _submun1);   
_bomblet21 setVelocity [-8,-8,-6]; 
_bomblet22 = "B_30mm_HE" createVehicle (getpos _submun1);   
_bomblet22 setVelocity [10,10,-6]; 
_bomblet23 = "B_30mm_HE" createVehicle (getpos _submun1);   
_bomblet23 setVelocity [-10,10,-6]; 
_bomblet24 = "B_30mm_HE" createVehicle (getpos _submun1);   
_bomblet24 setVelocity [10,-10,-6]; 
_bomblet25 = "B_30mm_HE" createVehicle (getpos _submun1);   
_bomblet25 setVelocity [-10,-10,-6]; 
_bomblet26 = "B_30mm_HE" createVehicle (getpos _submun2);   
_bomblet26 setVelocity [2,10,-6]; 
_bomblet27 = "B_30mm_HE" createVehicle (getpos _submun2);   
_bomblet27 setVelocity [-2,10,-6]; 
_bomblet28 = "B_30mm_HE" createVehicle (getpos _submun2);   
_bomblet28 setVelocity [4,10,-6]; 
_bomblet29 = "B_30mm_HE" createVehicle (getpos _submun2);   
_bomblet29 setVelocity [-4,10,-6]; 
_bomblet30 = "B_30mm_HE" createVehicle (getpos _submun2);   
_bomblet30 setVelocity [6,10,-6]; 
_bomblet31 = "B_30mm_HE" createVehicle (getpos _submun2);   
_bomblet31 setVelocity [-6,10,-6]; 
_bomblet32 = "B_30mm_HE" createVehicle (getpos _submun2);   
_bomblet32 setVelocity [8,10,-6]; 
_bomblet33 = "B_30mm_HE" createVehicle (getpos _submun2);   
_bomblet33 setVelocity [-8,10,-6]; 
_bomblet34 = "B_30mm_HE" createVehicle (getpos _submun2);   
_bomblet34 setVelocity [2,10,-6]; 
_bomblet35 = "B_30mm_HE" createVehicle (getpos _submun2);   
_bomblet35 setVelocity [-2,-10,-6]; 
_bomblet36 = "B_30mm_HE" createVehicle (getpos _submun2);   
_bomblet36 setVelocity [4,-10,-6]; 
_bomblet37 = "B_30mm_HE" createVehicle (getpos _submun2);   
_bomblet37 setVelocity [-4,-10,-6]; 
_bomblet38 = "B_30mm_HE" createVehicle (getpos _submun2);   
_bomblet38 setVelocity [6,-10,-6]; 
_bomblet39 = "B_30mm_HE" createVehicle (getpos _submun2);   
_bomblet39 setVelocity [-6,-10,-6]; 
_bomblet40 = "B_30mm_HE" createVehicle (getpos _submun2);   
_bomblet40 setVelocity [8,-10,-6]; 
_bomblet41 = "B_30mm_HE" createVehicle (getpos _submun2);   
_bomblet41 setVelocity [-8,10,-6]; 
_bomblet42 = "B_30mm_HE" createVehicle (getpos _submun2);   
_bomblet42 setVelocity [2,16,-6]; 
_bomblet43 = "B_30mm_HE" createVehicle (getpos _submun2);   
_bomblet43 setVelocity [-2,16,-6]; 
_bomblet44 = "B_30mm_HE" createVehicle (getpos _submun2);   
_bomblet44 setVelocity [4,16,-6]; 
_bomblet45 = "B_30mm_HE" createVehicle (getpos _submun2);   
_bomblet45 setVelocity [-4,16,-6]; 
_bomblet46 = "B_30mm_HE" createVehicle (getpos _submun2);   
_bomblet46 setVelocity [6,16,-6]; 
_bomblet47 = "B_30mm_HE" createVehicle (getpos _submun2);   
_bomblet47 setVelocity [-6,16,-6]; 
_bomblet48 = "B_30mm_HE" createVehicle (getpos _submun2);   
_bomblet48 setVelocity [8,16,-6]; 
_bomblet49 = "B_30mm_HE" createVehicle (getpos _submun2);   
_bomblet49 setVelocity [-8,16,-6]; 
_bomblet50 = "B_30mm_HE" createVehicle (getpos _submun2);   
_bomblet50 setVelocity [2,-16,-6]; 
_bomblet51 = "B_30mm_HE" createVehicle (getpos _submun3);   
_bomblet51 setVelocity [-2,-16,-6]; 
_bomblet52 = "B_30mm_HE" createVehicle (getpos _submun3);   
_bomblet52 setVelocity [4,-16,-6]; 
_bomblet53 = "B_30mm_HE" createVehicle (getpos _submun3);   
_bomblet53 setVelocity [-4,-16,-6]; 
_bomblet54 = "B_30mm_HE" createVehicle (getpos _submun3);   
_bomblet54 setVelocity [6,-16,-6]; 
_bomblet55 = "B_30mm_HE" createVehicle (getpos _submun3);   
_bomblet55 setVelocity [-6,-16,-6]; 
_bomblet56 = "B_30mm_HE" createVehicle (getpos _submun3);   
_bomblet56 setVelocity [8,-16,-6]; 
_bomblet57 = "B_30mm_HE" createVehicle (getpos _submun3);   
_bomblet57 setVelocity [-8,-16,-6]; 
_bomblet58 = "B_30mm_HE" createVehicle (getpos _submun3);   
_bomblet58 setVelocity [2,20,-6]; 
_bomblet59 = "B_30mm_HE" createVehicle (getpos _submun3);   
_bomblet59 setVelocity [-2,20,-6]; 
_bomblet60 = "B_30mm_HE" createVehicle (getpos _submun3);   
_bomblet60 setVelocity [4,20,-6]; 
_bomblet61 = "B_30mm_HE" createVehicle (getpos _submun3);   
_bomblet61 setVelocity [-4,20,-6]; 
_bomblet62 = "B_30mm_HE" createVehicle (getpos _submun3);   
_bomblet62 setVelocity [6,20,-6]; 
_bomblet63 = "B_30mm_HE" createVehicle (getpos _submun3);   
_bomblet63 setVelocity [-6,20,-6]; 
_bomblet64 = "B_30mm_HE" createVehicle (getpos _submun3);   
_bomblet64 setVelocity [8,20,-6]; 
_bomblet65 = "B_30mm_HE" createVehicle (getpos _submun3);   
_bomblet65 setVelocity [-8,20,-6]; 
_bomblet66 = "B_30mm_HE" createVehicle (getpos _submun3);   
_bomblet66 setVelocity [2,-20,-6]; 
_bomblet67 = "B_30mm_HE" createVehicle (getpos _submun3);   
_bomblet67 setVelocity [-2,-20,-6]; 
_bomblet68 = "B_30mm_HE" createVehicle (getpos _submun3);   
_bomblet68 setVelocity [4,-20,-6]; 
_bomblet69 = "B_30mm_HE" createVehicle (getpos _submun3);   
_bomblet69 setVelocity [-4,-20,-6]; 
_bomblet70 = "B_30mm_HE" createVehicle (getpos _submun3);   
_bomblet70 setVelocity [6,-20,-6]; 
_bomblet71 = "B_30mm_HE" createVehicle (getpos _submun3);   
_bomblet71 setVelocity [-6,-20,-6]; 
_bomblet72 = "B_30mm_HE" createVehicle (getpos _submun3);   
_bomblet72 setVelocity [8,-20,-6]; 
_bomblet73 = "B_30mm_HE" createVehicle (getpos _submun3);   
_bomblet73 setVelocity [-8,-20,-6]; 
_bomblet74 = "B_30mm_HE" createVehicle (getpos _submun3);   
_bomblet74 setVelocity [2,8,-6]; 
_bomblet75 = "B_30mm_HE" createVehicle (getpos _submun3);   
_bomblet75 setVelocity [-2,8,-6]; 
_bomblet76 = "B_30mm_HE" createVehicle (getpos _submun4);   
_bomblet76 setVelocity [4,8,-6]; 
_bomblet77 = "B_30mm_HE" createVehicle (getpos _submun4);   
_bomblet77 setVelocity [-4,8,-6]; 
_bomblet78 = "B_30mm_HE" createVehicle (getpos _submun4);   
_bomblet78 setVelocity [6,8,-6]; 
_bomblet79 = "B_30mm_HE" createVehicle (getpos _submun4);   
_bomblet79 setVelocity [-6,8,-6]; 
_bomblet80 = "B_30mm_HE" createVehicle (getpos _submun4);   
_bomblet80 setVelocity [2,-8,-6]; 
_bomblet81 = "B_30mm_HE" createVehicle (getpos _submun4);   
_bomblet81 setVelocity [-2,-8,-6]; 
_bomblet82 = "B_30mm_HE" createVehicle (getpos _submun4);   
_bomblet82 setVelocity [4,-8,-6]; 
_bomblet83 = "B_30mm_HE" createVehicle (getpos _submun4);   
_bomblet83 setVelocity [-4,-8,-6]; 
_bomblet84 = "B_30mm_HE" createVehicle (getpos _submun4);   
_bomblet84 setVelocity [6,-8,-6]; 
_bomblet85 = "B_30mm_HE" createVehicle (getpos _submun4);   
_bomblet85 setVelocity [-6,-8,-6]; 
_bomblet86 = "B_30mm_HE" createVehicle (getpos _submun4);   
_bomblet86 setVelocity [2,4,-6]; 
_bomblet87 = "B_30mm_HE" createVehicle (getpos _submun4);   
_bomblet87 setVelocity [-2,4,-6]; 
_bomblet88 = "B_30mm_HE" createVehicle (getpos _submun4);   
_bomblet88 setVelocity [4,4,-6]; 
_bomblet89 = "B_30mm_HE" createVehicle (getpos _submun4);   
_bomblet89 setVelocity [-4,4,-6]; 
_bomblet90 = "B_30mm_HE" createVehicle (getpos _submun4);   
_bomblet90 setVelocity [6,4,-6]; 
_bomblet91 = "B_30mm_HE" createVehicle (getpos _submun4);   
_bomblet91 setVelocity [-6,4,-6]; 
_bomblet92 = "B_30mm_HE" createVehicle (getpos _submun4);   
_bomblet92 setVelocity [8,4,-6]; 
_bomblet93 = "B_30mm_HE" createVehicle (getpos _submun4);   
_bomblet93 setVelocity [-8,4,-6]; 
_bomblet94 = "B_30mm_HE" createVehicle (getpos _submun4);   
_bomblet94 setVelocity [2,-4,-6]; 
_bomblet95 = "B_30mm_HE" createVehicle (getpos _submun4);   
_bomblet95 setVelocity [-2,-4,-6]; 
_bomblet96 = "B_30mm_HE" createVehicle (getpos _submun4);   
_bomblet96 setVelocity [4,-4,-6]; 
_bomblet97 = "B_30mm_HE" createVehicle (getpos _submun4);   
_bomblet97 setVelocity [-4,-4,-6]; 
_bomblet98 = "B_30mm_HE" createVehicle (getpos _submun4);   
_bomblet98 setVelocity [6,-4,-6]; 
_bomblet99 = "B_30mm_HE" createVehicle (getpos _submun4);   
_bomblet99 setVelocity [-6,-4,-6]; 
_bomblet100 = "B_30mm_HE" createVehicle (getpos _submun4);   
_bomblet100 setVelocity [8,-4,-6];

hint "End of script";

This creates a falling bomb that dissappears at 70m height, spreads 4 bomblets which each create 25 bomblets 0.5s later. I'm pretty satisfied with the cluster itself, except that it's a bit of an oval that's always facing north-south, where I want it to face the direction of the bomb. With help of the WiKi I created the following, but it only creates bomblet1 then the script freezes: :confused:

_bomb = "Bo_Mk82" createvehicle [2000,2000,2000];
_bomb attachTo [CBUBomber,[0,0,-5]];
sleep 0.5;
detach _bomb;
waitUntil {((getPos _bomb select 2) < 50)};

_vel = velocity _bomb;

_submun1 = "B_30mm_HE" createVehicle (getPos _bomb);
_submun1 setVelocity [(_vel select 0),(_vel select 1),(_vel select 2)];
_submun2 = "B_30mm_HE" createVehicle (getPos _bomb);
_submun2 setVelocity [(_vel select 0),(_vel select 1),(_vel select 2)];
_submun3 = "B_30mm_HE" createVehicle (getPos _bomb);
_submun3 setVelocity [(_vel select 0),(_vel select 1),(_vel select 2)];
_submun4 = "B_30mm_HE" createVehicle (getPos _bomb);
_submun4 setVelocity [(_vel select 0),(_vel select 1),(_vel select 2)];

deleteVehicle _bomb;
sleep 0.5;

_vel1 = velocity _submun1;
_dir1 = direction _submun1;
_speed1 = 1;
_submun1 setVelocity [(_vel1 select 0)+(sin _dir1*_speed1)+30,(_vel1 select 1)+(cos _dir1*_speed1)+30,(_vel1 select 2)];
_vel2 = velocity _submun2;
_dir2 = direction _submun2;
_speed2 = 1;
_submun2 setVelocity [(_vel2 select 0)+(sin _dir2*_speed2)+30,(_vel2 select 1)+(cos _dir2*_speed2)-30,(_vel2 select 2)];
_vel3 = velocity _submun3;
_dir3 = direction _submun3;
_speed3 = 1;
_submun3 setVelocity [(_vel3 select 0)+(sin _dir3*_speed3)-30,(_vel3 select 1)+(cos _dir3*_speed3)+30,(_vel3 select 2)];
_vel4 = velocity _submun4;
_dir4 = direction _submun4;
_speed4 = 1;
_submun4 setVelocity [(_vel4 select 0)+(sin _dir4*_speed4)-30,(_vel4 select 1)+(cos _dir4*_speed4)-30,(_vel4 select 2)];

sleep 0.5;

_bomblet1 = "B_30mm_HE" createVehicle (getpos _submun1);   
_bomblet1 setVelocity [1,0,-6];
_bomblet2 = "B_30mm_HE" createVehicle (getpos _submun1);   
_bomblet2 setVelocity [-1,0,-6];
etcetera

Does anyone know what's going wrong?

---------- Post added at 14:41 ---------- Previous post was at 13:50 ----------

UPDATE:

I started to experiment a bit with Joshii's script, and tried out the eventHandler he used in the following setup:

A-10 named CBUBomber - Init:

this addeventhandler ["fired",{_this execVM "CBU\deleteBomb.sqf"}];

deleteBomb:

_bomb = nearestobject [_this select 0,"Bo_GBU12_LGB"];
sleep 1;
deleteVehicle _bomb;
hint "Bomb Deleted";

Right now the bombs are visible on the plane, they are fired as normal weapons and as of now can be laser guided. I think this is the most solid approach when not making thing too complicated. I'll see if I can give ammo point an addAction to (although not visually) replace the GBUs with CBUs. I already removed the GBUs and added weapon + ammo for the MK20s, but they aren't attached to the bomb rails and simply spawn under the plane. :(

Edited by NGagedFX

Share this post


Link to post
Share on other sites

Maybe you did something wrong? I dunno anyhow here is my test mission it's working fine for me.

However be sure to be at above clusterheight in my case 70 meters when dropping it otherwise it wont work.

Cluster.Desert_E

http://uploaded.to/file/3ln3ar

______

I will just pickup some of your ideas and state my point to them.

Other things I got on my mind are:

-Not activated through the action menu, but as a normal weapon*

-Smoke/sound effect when detoning _bomb into submunition

-An AT version with possibly "B_25mm_APDS", "B_30mm_AP" or "B_30mmA10_AP" _subammo to destroy/disable/damage light/medium/heavy armor

Well normal weapon is quite simple you can either do an entire addon which would not make it a script anymore. Also I have no idea how that works. The easier way is possibly to just limit the script on one weapon.

Smoke is easy to do. I would write a function that is called on each to add smoke to it.

Sound is more difficult but not impossible.

Different ammo versions is simply done either by a GUI or by a simple menu in the radio.

Edited by Joshii

Share this post


Link to post
Share on other sites

I tried your mission and it's no different. No matter what weapon I fire, even if it's at 300m height, there's only a hint saying "any" and nothing else happens. :confused:

For firing it as a normal weapon: read the update of my previous post (I just updated the update :p). I'm still trying if it's possible to have MK20 on the rails to show more of a difference, and it would be nice to be able to choose like 2 GBU and 2 CBU for instance.

I'm not sure about what you mean with a function to add smoke, but I'll google my way into it. I really appreciate your help! :)

Share this post


Link to post
Share on other sites

That's quite weird.

For me I start up in the A-10 drop any bomb on the right a hint appears and count the meters till impact at 30 it stops switches over to the bombing part and does it all well.

Could you by any chance clear your arma2.rpt restart the mission and post me your rpt in here when your done?

Share this post


Link to post
Share on other sites

Yeah ofcourse. :)

It only displayed a single error repeated about 300 times:

arma2OA.RPT

Error in expression <[_this select 6] execVM "debug.sqf">
 Error position: <select 6] execVM "debug.sqf">
 Error Zero divisor

By the way, I've been bussy with testing A-10 loadouts, and it really depends on the order in which you add weapons and which rail they can use. For anyone out there that wants to customize an A-10's loadout without using addons and worries about the position, here is my reference:

A-10 Weapon Loadout Reference

\\*********************************************//
\\*A-10 Weapon Loadouts by NGagedFX or QuakeFX*//
\\*********************************************//
\\
\\This is basically meant just as a reference of where weapons will appear
\\Positions are counted from left to right and might have personal notes added
\\Note that the order in which you add/remove weapons does matter
\\If something is wrong, please let me know
\\
\\Position 1: Targeting Cam
\\Position 2: Hydra Pod
\\Position 9: Hydra Pod
\\Position 10 + 11: A dual-rail attached to a single rail
\\Other Positions: Independend rails for mounting different weapons
\\
\\
\\If you want to run this as a script, safe this as a .sqf in your mission folder and put in the A-10s init:
\\[this] exec "weaponLoadout.sqf";
\\And remove the 2 slashes in front of the lines that need to be executed

_this = _this select 0;


\\Removing the desired weapons and ammunition
\\_this removeWeapon "GAU8";
\\_this removeMagazine "1350Rnd_30mmAP_A10";
_this removeWeapon "MaverickLauncher";
_this removeMagazine "2Rnd_Maverick_A10";
_this removeWeapon "SidewinderLaucher_AH1Z";
_this removeMagazine "2Rnd_Sidewinder_AH1Z";
_this removeWeapon "BombLauncherA10";
_this removeMagazine "4Rnd_GBU12";
\\_this removeWeapon "FFARLauncher_14";
\\_this removeMagazine "14Rnd_FFAR";


\\Adding the desired weapon and ammunitions


\\Too simply double the amount of Hydras
\\_this removeWeapon "FFARLauncher_14";
\\_this removeMagazine "14Rnd_FFAR";
\\_this addWeapon "FFARLauncher";
\\_this addMagazine "28Rnd_FFAR";


\\Position x x 3 x x x x 8 x x x
\\_this addWeapon "MaverickLauncher";
\\_this addMagazine "2Rnd_Maverick_A10";
\\Position x x x x x x x x x 10 11
\\_this addWeapon "SidewinderLaucher_AH1Z";
\\_this addMagazine "2Rnd_Sidewinder_AH1Z";
\\Position x x x 4 5 6 7 x x x x - 2 come out of the middle of the plane
\\_this addWeapon "Mk82BombLauncher_6";
\\_this addMagazine "6Rnd_Mk82";
\\If you managed to remove the Mavericks and have 6 MK20s added at positions 3-9, please let me know :)


\\Position x x 3 x x x x 8 x x x
\\_this addWeapon "MaverickLauncher";
\\_this addMagazine "2Rnd_Maverick_A10";
\\Position x x x 4 5 6 7 x x 10 11 - using the Sidewinder rail will look kinda weird and have an offset
\\_this addWeapon "Mk82BombLauncher_6";
\\_this addMagazine "6Rnd_Mk82";


\\Position x x x x x x x 8 x x 11
\\_this addWeapon "SidewinderLaucher_AH1Z";
\\_this addMagazine "2Rnd_Sidewinder_AH1Z";
\\Position x x x 4 5 6 7 x x 10 11 - using the Sidewinder rail will look kinda weird and have an offset
\\_this addWeapon "Mk82BombLauncher_6";
\\_this addMagazine "6Rnd_Mk82";


\\Position x x 3 x x x x 8 x x x
\\_this addWeapon "MaverickLauncher";
\\_this addMagazine "2Rnd_Maverick_A10";
\\Position x x x x x x x x x 10 11
\\_this addWeapon "SidewinderLaucher_AH1Z";
\\_this addMagazine "2Rnd_Sidewinder_AH1Z";
\\Position x x x x 5 6 7 x x x x
\\_this addWeapon "Mk82BombLauncher";
\\_this addMagazine "3Rnd_Mk82";
\\Position x x x 4 x x x x x x x - Wil be unused


\\Position x x 3 x x x x 8 x x x
\\_this addWeapon "MaverickLauncher";
\\_this addMagazine "2Rnd_Maverick_A10";
\\Position x x x x x x x x x 10 11
\\_this addWeapon "SidewinderLaucher_AH1Z";
\\_this addMagazine "2Rnd_Sidewinder_AH1Z";
\\Position x x x 4 5 6 7 x x x x
\\_this addWeapon "Ch29Launcher";
\\_this addMagazine "4Rnd_Ch29";


\\Position x x 3 x x x x 8 x x x
\\_this addWeapon "MaverickLauncher";
\\_this addMagazine "2Rnd_Maverick_A10";
\\Position x x x x x x x x x 10 11
\\_this addWeapon "SidewinderLaucher_AH1Z";
\\_this addMagazine "2Rnd_Sidewinder_AH1Z";
\\Position x x x 4 5 6 7 x x x x
\\_this addWeapon "AirBombLauncher";
\\_this addMagazine "4Rnd_FAB_250";


\\Position x x 3 x 5 6 x 8 x x x
\\_this addWeapon "MaverickLauncher";
\\_this addMagazine "2Rnd_Maverick_A10";
\\Position x x x x x x x x x 10 11
\\_this addWeapon "SidewinderLaucher_AH1Z";
\\_this addMagazine "2Rnd_Sidewinder_AH1Z";
\\_this addMagazine "2Rnd_Maverick_A10";
\\Position x x x 4 x x 7 x x x x
\\_this addWeapon "AirBombLauncher";
\\_this addMagazine "2Rnd_FAB_250";
\\If you managed to add the Mavericks at 3478 and the FABs at 56, please let me know :)


\\Position x x 3 x 5 6 x 8 x x x
\\_this addWeapon "MaverickLauncher";
\\_this addMagazine "2Rnd_Maverick_A10";
\\Position x x x x x x x x x 10 11
\\_this addWeapon "SidewinderLaucher_AH1Z";
\\_this addMagazine "2Rnd_Sidewinder_AH1Z";
\\_this addMagazine "2Rnd_Maverick_A10";
\\Position x x x 4 x x 7 x x x x
\\_this addWeapon "AirBombLauncher";
\\_this addMagazine "2Rnd_FAB_250";

Joshii, I noted that the Bo_FAB_250 actually pretty much looks like a clusterbomb and handles like an MK20. So I plan on giving players the option to choose one of the above loadouts through an action menu near an ammo point (might reduce them to 4 to keep it simple) and have the Bo_FAB_250 function as a CBU. When the pilot drops one of those, the script will run a _bomb = nearestobject [_this select 0,"Bo_FAB_250"]; and continue from there. :) To add more visual difference between the AT and AP version, I'll check if it can also detect the M_Ch29_AT< and set it's velocity to match that of a bomb.

---------- Post added at 20:04 ---------- Previous post was at 19:49 ----------

EDIT:

I updated my script and it works wonderful with the FAB_250 loadouts. :)

AP_CBU.sqf

_bomb = nearestobject [_this select 0,"Bo_FAB_250"];
waitUntil {((getPos _bomb select 2) < 30)};

_submun1 = "B_30mm_HE" createVehicle (getPos _bomb);
_submun1 setVelocity [40,0,-6];
_submun2 = "B_30mm_HE" createVehicle (getPos _bomb);
_submun2 setVelocity [-40,0,-6];
_submun3 = "B_30mm_HE" createVehicle (getPos _bomb);
_submun3 setVelocity [20,0,-6];
_submun4 = "B_30mm_HE" createVehicle (getPos _bomb);
_submun4 setVelocity [-20,0,-6];
_submun5 = "B_30mm_HE" createVehicle (getPos _bomb);
_submun5 setVelocity [30,30,-6];
_submun6 = "B_30mm_HE" createVehicle (getPos _bomb);
_submun6 setVelocity [-30,30,-6];
_submun7 = "B_30mm_HE" createVehicle (getPos _bomb);
_submun7 setVelocity [30,-30,-6];
_submun8 = "B_30mm_HE" createVehicle (getPos _bomb);
_submun8 setVelocity [-30,-30,-6];
deleteVehicle _bomb;
sleep 0.5;

_bomblet = "B_30mm_HE" createVehicle (getpos _submun1);   
_bomblet setVelocity [1,0,-6];
_bomblet = "B_30mm_HE" createVehicle (getpos _submun1);   
_bomblet setVelocity [-1,0,-6];
_bomblet = "B_30mm_HE" createVehicle (getpos _submun1);   
_bomblet setVelocity [0,1,-6]; 
_bomblet = "B_30mm_HE" createVehicle (getpos _submun1);   
_bomblet setVelocity [0,-1,-6]; 
_bomblet = "B_30mm_HE" createVehicle (getpos _submun1);   
_bomblet setVelocity [0,1,-6]; 
_bomblet = "B_30mm_HE" createVehicle (getpos _submun1);   
_bomblet setVelocity [4,0,-6]; 
_bomblet = "B_30mm_HE" createVehicle (getpos _submun1);   
_bomblet setVelocity [-4,0,-6]; 
_bomblet = "B_30mm_HE" createVehicle (getpos _submun1);   
_bomblet setVelocity [0,4,-6]; 
_bomblet = "B_30mm_HE" createVehicle (getpos _submun1);   
_bomblet setVelocity [0,-4,-6]; 
_bomblet = "B_30mm_HE" createVehicle (getpos _submun1);   
_bomblet setVelocity [4,4,-6]; 
_bomblet = "B_30mm_HE" createVehicle (getpos _submun1);   
_bomblet setVelocity [-4,4,-6]; 
_bomblet = "B_30mm_HE" createVehicle (getpos _submun1);   
_bomblet setVelocity [4,-4,-6]; 
_bomblet = "B_30mm_HE" createVehicle (getpos _submun1);   
_bomblet setVelocity [-4,-4,-6]; 
_bomblet = "B_30mm_HE" createVehicle (getpos _submun1);   
_bomblet setVelocity [6,6,-6]; 
_bomblet = "B_30mm_HE" createVehicle (getpos _submun1);   
_bomblet setVelocity [-6,6,-6]; 
_bomblet = "B_30mm_HE" createVehicle (getpos _submun1);   
_bomblet setVelocity [6,-6,-6]; 
_bomblet = "B_30mm_HE" createVehicle (getpos _submun1);   
_bomblet setVelocity [-6,-6,-6]; 
_bomblet = "B_30mm_HE" createVehicle (getpos _submun1);   
_bomblet setVelocity [8,8,-6]; 
_bomblet = "B_30mm_HE" createVehicle (getpos _submun1);   
_bomblet setVelocity [-8,8,-6]; 
_bomblet = "B_30mm_HE" createVehicle (getpos _submun1);   
_bomblet setVelocity [8,-8,-6]; 
_bomblet = "B_30mm_HE" createVehicle (getpos _submun1);   
_bomblet setVelocity [-8,-8,-6]; 
_bomblet = "B_30mm_HE" createVehicle (getpos _submun1);   
_bomblet setVelocity [10,10,-6]; 
_bomblet = "B_30mm_HE" createVehicle (getpos _submun1);   
_bomblet setVelocity [-10,10,-6]; 
_bomblet = "B_30mm_HE" createVehicle (getpos _submun1);   
_bomblet setVelocity [10,-10,-6]; 
_bomblet = "B_30mm_HE" createVehicle (getpos _submun1);   
_bomblet setVelocity [-10,-10,-6]; 
_bomblet = "B_30mm_HE" createVehicle (getpos _submun2);   
_bomblet setVelocity [2,10,-6]; 
_bomblet = "B_30mm_HE" createVehicle (getpos _submun2);   
_bomblet setVelocity [-2,10,-6]; 
_bomblet = "B_30mm_HE" createVehicle (getpos _submun2);   
_bomblet setVelocity [4,10,-6]; 
_bomblet = "B_30mm_HE" createVehicle (getpos _submun2);   
_bomblet setVelocity [-4,10,-6]; 
_bomblet = "B_30mm_HE" createVehicle (getpos _submun2);   
_bomblet setVelocity [6,10,-6]; 
_bomblet = "B_30mm_HE" createVehicle (getpos _submun2);   
_bomblet setVelocity [-6,10,-6]; 
_bomblet = "B_30mm_HE" createVehicle (getpos _submun2);   
_bomblet setVelocity [8,10,-6]; 
_bomblet = "B_30mm_HE" createVehicle (getpos _submun2);   
_bomblet setVelocity [-8,10,-6]; 
_bomblet = "B_30mm_HE" createVehicle (getpos _submun2);   
_bomblet setVelocity [2,10,-6]; 
_bomblet = "B_30mm_HE" createVehicle (getpos _submun2);   
_bomblet setVelocity [-2,-10,-6]; 
_bomblet = "B_30mm_HE" createVehicle (getpos _submun2);   
_bomblet setVelocity [4,-10,-6]; 
_bomblet = "B_30mm_HE" createVehicle (getpos _submun2);   
_bomblet setVelocity [-4,-10,-6]; 
_bomblet = "B_30mm_HE" createVehicle (getpos _submun2);   
_bomblet setVelocity [6,-10,-6]; 
_bomblet = "B_30mm_HE" createVehicle (getpos _submun2);   
_bomblet setVelocity [-6,-10,-6]; 
_bomblet = "B_30mm_HE" createVehicle (getpos _submun2);   
_bomblet setVelocity [8,-10,-6]; 
_bomblet = "B_30mm_HE" createVehicle (getpos _submun2);   
_bomblet setVelocity [-8,10,-6]; 
_bomblet = "B_30mm_HE" createVehicle (getpos _submun2);   
_bomblet setVelocity [2,16,-6]; 
_bomblet = "B_30mm_HE" createVehicle (getpos _submun2);   
_bomblet setVelocity [-2,16,-6]; 
_bomblet = "B_30mm_HE" createVehicle (getpos _submun2);   
_bomblet setVelocity [4,16,-6]; 
_bomblet = "B_30mm_HE" createVehicle (getpos _submun2);   
_bomblet setVelocity [-4,16,-6]; 
_bomblet = "B_30mm_HE" createVehicle (getpos _submun2);   
_bomblet setVelocity [6,16,-6]; 
_bomblet = "B_30mm_HE" createVehicle (getpos _submun2);   
_bomblet setVelocity [-6,16,-6]; 
_bomblet = "B_30mm_HE" createVehicle (getpos _submun2);   
_bomblet setVelocity [8,16,-6]; 
_bomblet = "B_30mm_HE" createVehicle (getpos _submun2);   
_bomblet setVelocity [-8,16,-6]; 
_bomblet = "B_30mm_HE" createVehicle (getpos _submun2);   
_bomblet setVelocity [2,-16,-6]; 
_bomblet = "B_30mm_HE" createVehicle (getpos _submun3);   
_bomblet setVelocity [-2,-16,-6]; 
_bomblet = "B_30mm_HE" createVehicle (getpos _submun3);   
_bomblet setVelocity [4,-16,-6]; 
_bomblet = "B_30mm_HE" createVehicle (getpos _submun3);   
_bomblet setVelocity [-4,-16,-6]; 
_bomblet = "B_30mm_HE" createVehicle (getpos _submun3);   
_bomblet setVelocity [6,-16,-6]; 
_bomblet = "B_30mm_HE" createVehicle (getpos _submun3);   
_bomblet setVelocity [-6,-16,-6]; 
_bomblet = "B_30mm_HE" createVehicle (getpos _submun3);   
_bomblet setVelocity [8,-16,-6]; 
_bomblet = "B_30mm_HE" createVehicle (getpos _submun3);   
_bomblet setVelocity [-8,-16,-6]; 
_bomblet = "B_30mm_HE" createVehicle (getpos _submun3);   
_bomblet setVelocity [2,20,-6]; 
_bomblet = "B_30mm_HE" createVehicle (getpos _submun3);   
_bomblet setVelocity [-2,20,-6]; 
_bomblet = "B_30mm_HE" createVehicle (getpos _submun3);   
_bomblet setVelocity [4,20,-6]; 
_bomblet = "B_30mm_HE" createVehicle (getpos _submun3);   
_bomblet setVelocity [-4,20,-6]; 
_bomblet = "B_30mm_HE" createVehicle (getpos _submun3);   
_bomblet setVelocity [6,20,-6]; 
_bomblet = "B_30mm_HE" createVehicle (getpos _submun3);   
_bomblet setVelocity [-6,20,-6]; 
_bomblet = "B_30mm_HE" createVehicle (getpos _submun3);   
_bomblet setVelocity [8,20,-6]; 
_bomblet = "B_30mm_HE" createVehicle (getpos _submun3);   
_bomblet setVelocity [-8,20,-6]; 
_bomblet = "B_30mm_HE" createVehicle (getpos _submun3);   
_bomblet setVelocity [2,-20,-6]; 
_bomblet = "B_30mm_HE" createVehicle (getpos _submun3);   
_bomblet setVelocity [-2,-20,-6]; 
_bomblet = "B_30mm_HE" createVehicle (getpos _submun3);   
_bomblet setVelocity [4,-20,-6]; 
_bomblet = "B_30mm_HE" createVehicle (getpos _submun3);   
_bomblet setVelocity [-4,-20,-6]; 
_bomblet = "B_30mm_HE" createVehicle (getpos _submun3);   
_bomblet setVelocity [6,-20,-6]; 
_bomblet = "B_30mm_HE" createVehicle (getpos _submun3);   
_bomblet setVelocity [-6,-20,-6]; 
_bomblet = "B_30mm_HE" createVehicle (getpos _submun3);   
_bomblet setVelocity [8,-20,-6]; 
_bomblet = "B_30mm_HE" createVehicle (getpos _submun3);   
_bomblet setVelocity [-8,-20,-6]; 
_bomblet = "B_30mm_HE" createVehicle (getpos _submun3);   
_bomblet setVelocity [2,8,-6]; 
_bomblet = "B_30mm_HE" createVehicle (getpos _submun3);   
_bomblet setVelocity [-2,8,-6]; 
_bomblet = "B_30mm_HE" createVehicle (getpos _submun4);   
_bomblet setVelocity [4,8,-6]; 
_bomblet = "B_30mm_HE" createVehicle (getpos _submun4);   
_bomblet setVelocity [-4,8,-6]; 
_bomblet = "B_30mm_HE" createVehicle (getpos _submun4);   
_bomblet setVelocity [6,8,-6]; 
_bomblet = "B_30mm_HE" createVehicle (getpos _submun4);   
_bomblet setVelocity [-6,8,-6]; 
_bomblet = "B_30mm_HE" createVehicle (getpos _submun4);   
_bomblet setVelocity [2,-8,-6]; 
_bomblet = "B_30mm_HE" createVehicle (getpos _submun4);   
_bomblet setVelocity [-2,-8,-6]; 
_bomblet = "B_30mm_HE" createVehicle (getpos _submun4);   
_bomblet setVelocity [4,-8,-6]; 
_bomblet = "B_30mm_HE" createVehicle (getpos _submun4);   
_bomblet setVelocity [-4,-8,-6]; 
_bomblet = "B_30mm_HE" createVehicle (getpos _submun4);   
_bomblet setVelocity [6,-8,-6]; 
_bomblet = "B_30mm_HE" createVehicle (getpos _submun4);   
_bomblet setVelocity [-6,-8,-6]; 
_bomblet = "B_30mm_HE" createVehicle (getpos _submun4);   
_bomblet setVelocity [2,4,-6]; 
_bomblet = "B_30mm_HE" createVehicle (getpos _submun4);   
_bomblet setVelocity [-2,4,-6]; 
_bomblet = "B_30mm_HE" createVehicle (getpos _submun4);   
_bomblet setVelocity [4,4,-6]; 
_bomblet = "B_30mm_HE" createVehicle (getpos _submun4);   
_bomblet setVelocity [-4,4,-6]; 
_bomblet = "B_30mm_HE" createVehicle (getpos _submun4);   
_bomblet setVelocity [6,4,-6]; 
_bomblet = "B_30mm_HE" createVehicle (getpos _submun4);   
_bomblet setVelocity [-6,4,-6]; 
_bomblet = "B_30mm_HE" createVehicle (getpos _submun4);   
_bomblet setVelocity [8,4,-6]; 
_bomblet = "B_30mm_HE" createVehicle (getpos _submun4);   
_bomblet setVelocity [-8,4,-6]; 
_bomblet = "B_30mm_HE" createVehicle (getpos _submun4);   
_bomblet setVelocity [2,-4,-6]; 
_bomblet = "B_30mm_HE" createVehicle (getpos _submun4);   
_bomblet setVelocity [-2,-4,-6]; 
_bomblet = "B_30mm_HE" createVehicle (getpos _submun4);   
_bomblet setVelocity [4,-4,-6]; 
_bomblet = "B_30mm_HE" createVehicle (getpos _submun4);   
_bomblet setVelocity [-4,-4,-6]; 
_bomblet = "B_30mm_HE" createVehicle (getpos _submun4);   
_bomblet setVelocity [6,-4,-6]; 
_bomblet = "B_30mm_HE" createVehicle (getpos _submun4);   
_bomblet setVelocity [-6,-4,-6]; 
_bomblet = "B_30mm_HE" createVehicle (getpos _submun4);   
_bomblet setVelocity [8,-4,-6];
_bomblet = "B_30mm_HE" createVehicle (getpos _submun5);   
_bomblet setVelocity [1,0,-6];
_bomblet = "B_30mm_HE" createVehicle (getpos _submun5);   
_bomblet setVelocity [-1,0,-6];
_bomblet = "B_30mm_HE" createVehicle (getpos _submun5);   
_bomblet setVelocity [0,1,-6]; 
_bomblet = "B_30mm_HE" createVehicle (getpos _submun5);   
_bomblet setVelocity [0,-1,-6]; 
_bomblet = "B_30mm_HE" createVehicle (getpos _submun5);   
_bomblet setVelocity [0,1,-6]; 
_bomblet = "B_30mm_HE" createVehicle (getpos _submun5);   
_bomblet setVelocity [4,0,-6]; 
_bomblet = "B_30mm_HE" createVehicle (getpos _submun5);   
_bomblet setVelocity [-4,0,-6]; 
_bomblet = "B_30mm_HE" createVehicle (getpos _submun5);   
_bomblet setVelocity [0,4,-6]; 
_bomblet = "B_30mm_HE" createVehicle (getpos _submun5);   
_bomblet setVelocity [0,-4,-6]; 
_bomblet = "B_30mm_HE" createVehicle (getpos _submun5);   
_bomblet setVelocity [4,4,-6]; 
_bomblet = "B_30mm_HE" createVehicle (getpos _submun5);   
_bomblet setVelocity [-4,4,-6]; 
_bomblet = "B_30mm_HE" createVehicle (getpos _submun5);   
_bomblet setVelocity [4,-4,-6]; 
_bomblet = "B_30mm_HE" createVehicle (getpos _submun5);   
_bomblet setVelocity [-4,-4,-6]; 
_bomblet = "B_30mm_HE" createVehicle (getpos _submun5);   
_bomblet setVelocity [6,6,-6]; 
_bomblet = "B_30mm_HE" createVehicle (getpos _submun5);   
_bomblet setVelocity [-6,6,-6]; 
_bomblet = "B_30mm_HE" createVehicle (getpos _submun5);   
_bomblet setVelocity [6,-6,-6]; 
_bomblet = "B_30mm_HE" createVehicle (getpos _submun5);   
_bomblet setVelocity [-6,-6,-6]; 
_bomblet = "B_30mm_HE" createVehicle (getpos _submun5);   
_bomblet setVelocity [8,8,-6]; 
_bomblet = "B_30mm_HE" createVehicle (getpos _submun5);   
_bomblet setVelocity [-8,8,-6]; 
_bomblet = "B_30mm_HE" createVehicle (getpos _submun5);   
_bomblet setVelocity [8,-8,-6]; 
_bomblet = "B_30mm_HE" createVehicle (getpos _submun5);   
_bomblet setVelocity [-8,-8,-6]; 
_bomblet = "B_30mm_HE" createVehicle (getpos _submun5);   
_bomblet setVelocity [10,10,-6]; 
_bomblet = "B_30mm_HE" createVehicle (getpos _submun5);   
_bomblet setVelocity [-10,10,-6]; 
_bomblet = "B_30mm_HE" createVehicle (getpos _submun5);   
_bomblet setVelocity [10,-10,-6]; 
_bomblet = "B_30mm_HE" createVehicle (getpos _submun5);   
_bomblet setVelocity [-10,-10,-6]; 
_bomblet = "B_30mm_HE" createVehicle (getpos _submun6);   
_bomblet setVelocity [2,10,-6]; 
_bomblet = "B_30mm_HE" createVehicle (getpos _submun6);   
_bomblet setVelocity [-2,10,-6]; 
_bomblet = "B_30mm_HE" createVehicle (getpos _submun6);   
_bomblet setVelocity [4,10,-6]; 
_bomblet = "B_30mm_HE" createVehicle (getpos _submun6);   
_bomblet setVelocity [-4,10,-6]; 
_bomblet = "B_30mm_HE" createVehicle (getpos _submun6);   
_bomblet setVelocity [6,10,-6]; 
_bomblet = "B_30mm_HE" createVehicle (getpos _submun6);   
_bomblet setVelocity [-6,10,-6]; 
_bomblet = "B_30mm_HE" createVehicle (getpos _submun6);   
_bomblet setVelocity [8,10,-6]; 
_bomblet = "B_30mm_HE" createVehicle (getpos _submun6);   
_bomblet setVelocity [-8,10,-6]; 
_bomblet = "B_30mm_HE" createVehicle (getpos _submun6);   
_bomblet setVelocity [2,10,-6]; 
_bomblet = "B_30mm_HE" createVehicle (getpos _submun6);   
_bomblet setVelocity [-2,-10,-6]; 
_bomblet = "B_30mm_HE" createVehicle (getpos _submun6);   
_bomblet setVelocity [4,-10,-6]; 
_bomblet = "B_30mm_HE" createVehicle (getpos _submun6);   
_bomblet setVelocity [-4,-10,-6]; 
_bomblet = "B_30mm_HE" createVehicle (getpos _submun6);   
_bomblet setVelocity [6,-10,-6]; 
_bomblet = "B_30mm_HE" createVehicle (getpos _submun6);   
_bomblet setVelocity [-6,-10,-6]; 
_bomblet = "B_30mm_HE" createVehicle (getpos _submun6);   
_bomblet setVelocity [8,-10,-6]; 
_bomblet = "B_30mm_HE" createVehicle (getpos _submun6);   
_bomblet setVelocity [-8,10,-6]; 
_bomblet = "B_30mm_HE" createVehicle (getpos _submun6);   
_bomblet setVelocity [2,16,-6]; 
_bomblet = "B_30mm_HE" createVehicle (getpos _submun6);   
_bomblet setVelocity [-2,16,-6]; 
_bomblet = "B_30mm_HE" createVehicle (getpos _submun6);   
_bomblet setVelocity [4,16,-6]; 
_bomblet = "B_30mm_HE" createVehicle (getpos _submun6);   
_bomblet setVelocity [-4,16,-6]; 
_bomblet = "B_30mm_HE" createVehicle (getpos _submun6);   
_bomblet setVelocity [6,16,-6]; 
_bomblet = "B_30mm_HE" createVehicle (getpos _submun6);   
_bomblet setVelocity [-6,16,-6]; 
_bomblet = "B_30mm_HE" createVehicle (getpos _submun6);   
_bomblet setVelocity [8,16,-6]; 
_bomblet = "B_30mm_HE" createVehicle (getpos _submun6);   
_bomblet setVelocity [-8,16,-6]; 
_bomblet = "B_30mm_HE" createVehicle (getpos _submun6);   
_bomblet setVelocity [2,-16,-6];
_bomblet = "B_30mm_HE" createVehicle (getpos _submun7);   
_bomblet setVelocity [1,0,-6];
_bomblet = "B_30mm_HE" createVehicle (getpos _submun7);   
_bomblet setVelocity [-1,0,-6];
_bomblet = "B_30mm_HE" createVehicle (getpos _submun7);   
_bomblet setVelocity [0,1,-6]; 
_bomblet = "B_30mm_HE" createVehicle (getpos _submun7);   
_bomblet setVelocity [0,-1,-6]; 
_bomblet = "B_30mm_HE" createVehicle (getpos _submun7);   
_bomblet setVelocity [0,1,-6]; 
_bomblet = "B_30mm_HE" createVehicle (getpos _submun7);   
_bomblet setVelocity [4,0,-6]; 
_bomblet = "B_30mm_HE" createVehicle (getpos _submun7);   
_bomblet setVelocity [-4,0,-6]; 
_bomblet = "B_30mm_HE" createVehicle (getpos _submun7);   
_bomblet setVelocity [0,4,-6]; 
_bomblet = "B_30mm_HE" createVehicle (getpos _submun7);   
_bomblet setVelocity [0,-4,-6]; 
_bomblet = "B_30mm_HE" createVehicle (getpos _submun7);   
_bomblet setVelocity [4,4,-6]; 
_bomblet = "B_30mm_HE" createVehicle (getpos _submun7);   
_bomblet setVelocity [-4,4,-6]; 
_bomblet = "B_30mm_HE" createVehicle (getpos _submun7);   
_bomblet setVelocity [4,-4,-6]; 
_bomblet = "B_30mm_HE" createVehicle (getpos _submun7);   
_bomblet setVelocity [-4,-4,-6]; 
_bomblet = "B_30mm_HE" createVehicle (getpos _submun7);   
_bomblet setVelocity [6,6,-6]; 
_bomblet = "B_30mm_HE" createVehicle (getpos _submun7);   
_bomblet setVelocity [-6,6,-6]; 
_bomblet = "B_30mm_HE" createVehicle (getpos _submun7);   
_bomblet setVelocity [6,-6,-6]; 
_bomblet = "B_30mm_HE" createVehicle (getpos _submun7);   
_bomblet setVelocity [-6,-6,-6]; 
_bomblet = "B_30mm_HE" createVehicle (getpos _submun7);   
_bomblet setVelocity [8,8,-6]; 
_bomblet = "B_30mm_HE" createVehicle (getpos _submun7);   
_bomblet setVelocity [-8,8,-6]; 
_bomblet = "B_30mm_HE" createVehicle (getpos _submun7);   
_bomblet setVelocity [8,-8,-6]; 
_bomblet = "B_30mm_HE" createVehicle (getpos _submun7);   
_bomblet setVelocity [-8,-8,-6]; 
_bomblet = "B_30mm_HE" createVehicle (getpos _submun7);   
_bomblet setVelocity [10,10,-6]; 
_bomblet = "B_30mm_HE" createVehicle (getpos _submun7);   
_bomblet setVelocity [-10,10,-6]; 
_bomblet = "B_30mm_HE" createVehicle (getpos _submun7);   
_bomblet setVelocity [10,-10,-6]; 
_bomblet = "B_30mm_HE" createVehicle (getpos _submun7);   
_bomblet setVelocity [-10,-10,-6]; 
_bomblet = "B_30mm_HE" createVehicle (getpos _submun8);   
_bomblet setVelocity [2,10,-6]; 
_bomblet = "B_30mm_HE" createVehicle (getpos _submun8);   
_bomblet setVelocity [-2,10,-6]; 
_bomblet = "B_30mm_HE" createVehicle (getpos _submun8);   
_bomblet setVelocity [4,10,-6]; 
_bomblet = "B_30mm_HE" createVehicle (getpos _submun8);   
_bomblet setVelocity [-4,10,-6]; 
_bomblet = "B_30mm_HE" createVehicle (getpos _submun8);   
_bomblet setVelocity [6,10,-6]; 
_bomblet = "B_30mm_HE" createVehicle (getpos _submun8);   
_bomblet setVelocity [-6,10,-6]; 
_bomblet = "B_30mm_HE" createVehicle (getpos _submun8);   
_bomblet setVelocity [8,10,-6]; 
_bomblet = "B_30mm_HE" createVehicle (getpos _submun8);   
_bomblet setVelocity [-8,10,-6]; 
_bomblet = "B_30mm_HE" createVehicle (getpos _submun8);   
_bomblet setVelocity [2,10,-6]; 
_bomblet = "B_30mm_HE" createVehicle (getpos _submun8);   
_bomblet setVelocity [-2,-10,-6]; 
_bomblet = "B_30mm_HE" createVehicle (getpos _submun8);   
_bomblet setVelocity [4,-10,-6]; 
_bomblet = "B_30mm_HE" createVehicle (getpos _submun8);   
_bomblet setVelocity [-4,-10,-6]; 
_bomblet = "B_30mm_HE" createVehicle (getpos _submun8);   
_bomblet setVelocity [6,-10,-6]; 
_bomblet = "B_30mm_HE" createVehicle (getpos _submun8);   
_bomblet setVelocity [-6,-10,-6]; 
_bomblet = "B_30mm_HE" createVehicle (getpos _submun8);   
_bomblet setVelocity [8,-10,-6]; 
_bomblet = "B_30mm_HE" createVehicle (getpos _submun8);   
_bomblet setVelocity [-8,10,-6]; 
_bomblet = "B_30mm_HE" createVehicle (getpos _submun8);   
_bomblet setVelocity [2,16,-6]; 
_bomblet = "B_30mm_HE" createVehicle (getpos _submun8);   
_bomblet setVelocity [-2,16,-6]; 
_bomblet = "B_30mm_HE" createVehicle (getpos _submun8);   
_bomblet setVelocity [4,16,-6]; 
_bomblet = "B_30mm_HE" createVehicle (getpos _submun8);   
_bomblet setVelocity [-4,16,-6]; 
_bomblet = "B_30mm_HE" createVehicle (getpos _submun8);   
_bomblet setVelocity [6,16,-6]; 
_bomblet = "B_30mm_HE" createVehicle (getpos _submun8);   
_bomblet setVelocity [-6,16,-6]; 
_bomblet = "B_30mm_HE" createVehicle (getpos _submun8);   
_bomblet setVelocity [8,16,-6]; 
_bomblet = "B_30mm_HE" createVehicle (getpos _submun8);   
_bomblet setVelocity [-8,16,-6]; 
_bomblet = "B_30mm_HE" createVehicle (getpos _submun8);   
_bomblet setVelocity [2,-16,-6];

They are devastating versus infantry, and don't destroy the average HMMWV, so I guess that's a well balanced AP clusterbomb. I would still like to fix the velocity's direction and add a smoke/sound effect when it pops into submunition.

UPDATE:

Further testing revealed that the GAU-8 makes the game stutter (as it's trying the nearestObject on every single bullet) and that when holding down the mousebutton to release all of the FABS in one go makes it bug a bit, with often only the first and sometimes 2nd bomb acting as a CBU. And if I have a .ogg soundfile, then how to I call it from my script?

Edited by NGagedFX

Share this post


Link to post
Share on other sites

Make your script more readable and instead of doing the same thing 100 times just use a while loop with variables.

Share this post


Link to post
Share on other sites

I have no idea how to do that, that's why I did it this way. However, I found a simple workaround. On top of my script, I added:

_this = _this select 0;
_weaponClass = currentWeapon (vehicle _this);
sleep 0.01;
player sideChat format["_weaponClass: %1", _weaponClass];\\For testing purposes

if (_weaponClass == "AirBombLauncher") then
{
submunitions+bomblets+other stuff
}
else
{
};

Right now, only the FAB_250 triggers the nearestObject command and using the GAU-8 doesn't cause any lag or stuttering anymore. :)

Edited by NGagedFX

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  

×