vrTargets.sqf
/*
_coverBlocks = ["Land_VR_CoverObject_","Land_VR_Block_"] ;
[_coverBlocks] execVM "Types\WAVE\Type_LZ_WP_GP\vrTargets.sqf";
*/
params ["_coverBlocks"] ;
_passItOn = _coverBlocks;
_countOfThings = count _passItOn ;
hint("ok 5");
sleep 6;
for [{ _q = 0 }, { _q < _countOfThings }, { _q = _q + 1 }] do
{
_gats = [] ;
_gats = "true" configClasses (configFile >> "CfgVehicles" ) ;
_countEnt = count _gats ;
_dogs = [] ;
_scan = _passItOn select _q ;
_type = _scan ;
for [{ _p = 0 }, { _p < _countEnt }, { _p = _p + 1 }] do
{
_foolu = _gats select _p ;
_strag = (str _foolu) ;
_donk = _strag find _scan ;
if(_donk != -1) then
{
_dogs pushBack _foolu ;
};
};
_countDogs = count _dogs ;
_passers = [] ;
for [{ _p = 0 }, { _p < _countDogs }, { _p = _p + 1 }] do
{
_stol = _dogs select _p ;
_stool = (str _stol) ;
_donker = _stool find _type ;
_newBoyC = count _stool ;
_countn = _newBoyC - (_donker) ;
_newBoy = _stool select [_donker,_countn ] ;
_passers pushBack _newBoy ;
//_______________________________________________________________________________________________________________________
};
_countDogs = count _passers ;
_rackX = 32;
_rackY = 42;
rackBumpX = (8) ;
rackBumpY = 8;
randoz = 16 ;
randozz = 2 ;
halfdozz = 4 ;
_racks = _rackX * _rackY ;
_coffer = 0;
_markST = getPos coffin;
whax = 0 ;
whay = 0 ;
whaz = 0 ;
if(_q > 0) then
{
_someBlock = 20 ;
_pusX = (rackBumpX * _rackX ) ;
_pusY = (rackBumpY * _rackY ) ;
_pusX = floor (_pusX / _someBlock ) ;
_pusY = floor (_pusY / _someBlock ) ;
_pusX1 =floor ( _pusX / 2 ) ;
_pusY1 =floor ( _pusY / 2 ) ;
_rackX = _pusX1 ;
_rackY = _pusY1 ;
_someBlock = _someBlock * 2 ;
_coffer = _someBlock ;
rackBumpX = ( _someBlock ) ;
rackBumpY = ( _someBlock ) ;
randoz = _someBlock * 2 ;
};
_bumper = 1 ;
_pushX = (rackBumpX * _rackX ) / 2;
_pushY = (rackBumpY * _rackY ) / 2;
whax = ( _markST select 0 ) ;
whay = ( _markST select 1) ;
private _posOee = [(whax ),(whay ),(whaz)] ;
_markerG = createMarker ["battleZone", _posOee ];
_markerG setMarkerShape "RECTANGLE";
_markerG setMarkerSize [ _pushY , _pushX ];
hint("bombs away!") ;
sleep 2 ;
_pushX = (rackBumpX * _rackX ) / 2;
_pushY = (rackBumpY * _rackY ) / 2;
whax = ( _markST select 0 ) - _pushY ;
whay = ( _markST select 1) - _pushX ;
whaz = (-1) ;
if(_q > 0) then
{
whax = ( _markST select 0 ) - _pushY ;
whay = ( _markST select 1) - _pushX ;
whax = whax + _coffer;
whay = whay + _coffer;
whaz = (-12) ;
randozz = 9 ;
halfdozz = randozz / 2 ;
};
halfX = rackBumpX / 2 ;
halfY = rackBumpY / 2 ;
whaLoc = whax ;
whaLocY = whay ;
whaLocZ = whaz ;
halfDog = 2 ;
for [{ _h = 0 }, { _h < _rackX }, { _h = _h + 1 }] do
{
for [{ _j = 0 }, { _j < _rackY }, { _j = _j + 1 }] do
{
ranX = random [1, halfX , randoz ] ;
ranY = random [1, halfY , randoz ];
ranZ = random randozz ;
ranSel = random [ 0, halfDog , _countDogs] ;
ranDir = random [0, 180, 359] ;
ranSel = floor ranSel ;
_inPart = _passers select ranSel ;
_fun = (str _inPart) ;
whacx = whax - ranX;
whacy = whay - ranY;
whacz = whaz + ranZ ;
private _posNe = [(whacx),(whacy),(whacz)] ;
private _blam = "block"+ (str _h) + (str _j) ; ;
_blam = createVehicle [_inPart,_posNe,[],0,"CAN_COLLIDE"];
_blam setDir ranDir ;
vecX = random 9 ;
vecY = random 9 ;
vecZ = random 9 ;
vecX = vecX / 10 ;
vecY = vecY / 10 ;
vecZ = vecZ / 10 ;
_blam setVectorUp [vecX ,vecY ,vecZ ];
whax = whax + rackBumpX ;
};
whax = whaLoc ;
whay = whay + rackBumpY ;
};
};
hint ("OK") ;
sleep 4 ;