Code for the bottom half of the script - might be rough....
Code: Select all
code removed, see next post
PMC websites shut down November 13th 2025 unless web hosting fees are paid. See up to date status from PMC Website Hosting and Domain Registration Fee Status forum topic. Please Support PMC to help keep these websites online.
Moderators: Snake Man, Lone Wolf
Code: Select all
code removed, see next post
Code: Select all
_numbomblets = 40;
_factor = 1;
// plane altitude modifier
_altMod = (_planeAlt - 50) / 5;
for [{_b = 1}, {_b <= 5}, {_b = _b + 1}] do
{
for [{_g = 1}, {_g <= _numbomblets}, {_g = _g + 1}] do
{
// Position the bomblet
_rndOffset = (random 180) - 90;
_dir = _bDir + _rndOffset;
if ((_dir > 360) || (_dir < 0)) then
{
_dir = abs (abs (_dir) - 360);
};
_dist = (random 20) + _altMod;
_newposx = (_bpos select 0) + sin (_dir) * _dist;
_newposy = (_bpos select 1) + cos (_dir) * _dist;
// Create the bomblet
_bomblet = _bt createVehicleLocal [_newposx, _newposy, _height];
if (VTE_debug) then
{
player sideChat format["%1 bomblet created at %2.",_bomblet, getPos _bomblet];
};
// Randomise the z velocity
_nvz = _bvz * ((60 + random 80) / 100);
// Re-speed the bomb
_factor = 2 * _b;
_bomblet setVelocity [_bvx * _factor, _bvy * _factor, _nvz];
};
//stutter preventing sleep
sleep .3;
// advance the spot to help elongate the dispersion
_dist = 10; // tweakable
_newposx = (_bpos select 0) + sin (_bDir) * _dist;
_newposy = (_bpos select 1) + cos (_bDir) * _dist;
_bpos = [_newposx, _newposy, 0];
};
}
else
{
hint "You must be above 50m to drop this ordnance.";
};
Code: Select all
_numbomblets = 37;
_factor = 1;
// plane altitude modifier
_altMod = (_planeAlt - 50) / 5;
// 6 loops of 37 bombs = 222 bombs
for [{_b = 1}, {_b <= 6}, {_b = _b + 1}] do
{
for [{_g = 1}, {_g <= _numbomblets}, {_g = _g + 1}] do
{
// Position the bomblet
_rndOffset = (random 180) - 90;
_dir = _bDir + _rndOffset;
if ((_dir > 360) || (_dir < 0)) then
{
_dir = abs (abs (_dir) - 360);
};
_dist = (random 20) + _altMod;
_newposx = (_bpos select 0) + sin (_dir) * _dist;
_newposy = (_bpos select 1) + cos (_dir) * _dist;
// Create the bomblet
_bomblet = _bt createVehicleLocal [_newposx, _newposy, _height];
if (VTE_debug) then
{
player sideChat format["%1 bomblet created at %2.",_bomblet, getPos _bomblet];
};
// Randomise the z velocity
_nvz = _bvz * ((60 + random 80) / 100);
// Re-speed the bomb
// _factor = 2 + _b;
_fRandX = random 3;
_fRandY = random 3;
_bomblet setVelocity [_bvx * _fRandX, _bvy * _fRandY, _nvz];
};
//stutter preventing sleep
sleep .3;
// advance the spot to help elongate the dispersion
_dist = 10; // tweakable
_newposx = (_bpos select 0) + sin (_bDir) * _dist;
_newposy = (_bpos select 1) + cos (_bDir) * _dist;
_bpos = [_newposx, _newposy, 0];
};
}
else
{
hint "You must be above 50m to drop this ordnance.";
};
Code: Select all
...
_CBU = _CBU2;
_value = 201;
_done = false;
_i = 0;
_expulPos = (getPosASL _CBU);
for [{_i = 0}, {_i < _value}, {_i = _i + 1}] do
{
// hint format ["%1 \n %2 \n %3 \n %4",_CBU,_i,_subSelectionPos0,_subSelectionPos1];
_subSelectionPos0 = format ["subm_pos_CEB_%1",_i];
_sub = "VIG_BLU97_CEB_retarded" createVehicle [0,0,(450 + ((random 200)+(random 200)))];
_sub setVectorDirAndUp [vectorDir _CBU,vectorUp _CBU];
_sub setPosASL [((_expulPos select 0)-((random 6)-(random 6))),((_expulPos select 1)-((random 6)-(random 6))),((_expulPos select 2)-((random 6)-(random 6)))];
// _sub setVelocity (velocity _CBU);
// _sub setPos (_CBU selectionPosition _subSelectionPos);
// hint format ["%1 \n %2 \n %3",_CBU,_i,_subSelectionPos0];
_i = _i + 1;
_subSelectionPos1 = format ["subm_pos_CEB_%1",_i];
_sub2 = "VIG_BLU97_CEB_retarded" createVehicle [0,0,(450 + ((random 200)+(random 200)))];
_sub2 setVectorDirAndUp [vectorDir _CBU,vectorUp _CBU];
_sub2 setPosASL [((_expulPos select 0)-((random 6)-(random 6))),((_expulPos select 1)-((random 6)-(random 6))),((_expulPos select 2)-((random 6)-(random 6)))];
// _sub2 setVelocity (velocity _CBU);
// _sub2 setPos (_CBU selectionPosition _subSelectionPos);
/*
if ((_value > 50) && (!_done)) then
{
[ _sub, 165, 15, 2, 100, 100, 1, 1, 0, 0 ] exec "\gig_camera\freecamera.sqs";
_done = true;
};
*/
_dropscr0 = [_CBU,_sub] spawn VIG_TMD_DropSubmunitions;
_dropscr1 = [_CBU,_sub2] spawn VIG_TMD_DropSubmunitions;
hint format ["%1 \n %2 \n %3 \n %4",_CBU,_i,_subSelectionPos0,_subSelectionPos1];
sleep 0.01;
};
...
Code: Select all
_explosionSound = "VIG_Sounds_Explosion_Small_Muffled";
// here comes the sound effect
if ((count _subMunList) % 2 == 0) then
{
[_position,_explosionSound,550,3] spawn VIG_TmpSoundSource;
};
Website hosting fee is due, please Support PMC, thank you. You can read more details from PMC Website Hosting and Domain Registration Fee Status forum topic.