Now that school is over for awhile I finally had a chance to post my IED script.
Here is the script:
_bpos = []
_bpos1 = []
_bpos2 = []
_bpos = [(getpos j1 select 0) + (random (5*2)) - 5,(getpos j1 select 1) + (random (5*2)) - 5,-.95]
"HEAT120" camcreate _bpos
"SHELL120" camcreate _bpos
~random 2
_rndmObjNum1 = [3291,3294,125501,3289,3293,125510,3292,3290,125519] call RandomSelect
#ied2
_rndmObjNum2 = [3291,3294,125501,3289,3293,125510,3292,3290,125519] call RandomSelect
? (_rndmObjNum1 == _rndmObjNum2) : goto "ied2"
_rndmObj1 = object _rndmObjNum1
_bpos1 = [(getpos _rndmObj1 select 0),(getpos _rndmObj1 select 1) + (random (5*2)) - 5,-.95]
"HEAT120" camcreate _bpos1
"SHELL120" camcreate _bpos1
~ random 3
_rndmObj2 = object _rndmObjNum2
_bpos2 = [(getpos _rndmObj2 select 0) + (random (5*2)) - 5,(getpos _rndmObj2 select 1),-.95]
"HEAT120" camcreate _bpos2
"SHELL120" camcreate _bpos2
exit
You will also need this function by Joltan:
private ["_list","_ntotal","_random","_result","_target"];
_list=_this;
_ntotal=count _list;
_random=random(_ntotal);
_result=_random - ((_random) mod (1));
if (_result==_ntotal) then {_result=_result-1};
_target=_list select _result;
_target
I just used a side present trigger and on the activation line I put this in:
[] exec "randomIED.sqs"
Here is an addon free mission to see how this script works. It is a simple WIP ambush mission that gets right to the action.
Enjoy!
Wadmann