I knew someone would end up asking why.. my answer?
Why not? Because i could?
But mainly i was just porting old OFP scripts over and testing out the SQF syntax.
<table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">// get the unit from the first argument to use as the center point of the drop
_unit = _this;
// Width and height of the box that will be filled with bombs
_width = 1000;
_height = 1000;
// the step size while creating bombs, divide width by this to get the number of bombs per row, and divide height by this to get the number of bombs per column
// This step can be any number, but anything below about 200 will bring your computer to a crawl, possibly stalling it for up to 10mins while the game tries to figure out what to do
_step = 200;
_pos = position _unit;
// Setup the start point of the grid
_startX = (_pos select 0) - (_width / 2);
_startY = (_pos select 1) - (_height / 2);
// Loop through the width and height generating a bomb at each step
for [{_x=1},{_x<=_width},{_x=_x+_step}]
do {
for [{_y=1},{_y<=_height},{_y=_y+_step}]
do
{
_posX = _startX + _x;
_posY = _startY + _y;
// Generate a bomb 100 units in the air at the point
_bomb = "Bo_GBU12_LGB" CreateVehicle [ _posX, _posY, 100 ];
}