Jump to content
Sign in to follow this  
wld427

Mine Laying Script

Recommended Posts

OK .....

so i got this wild hair up my ass to try and get a mine laying script working for the PRACS OV-1 Mohawk....

I figured simply take the cluster bomb script and change out the exploding ammo with that of the regular Arma anti-tank mine.....

unfortunately it does not work..... i can put any other ammo in the script and it works perfectly ... jsut not the mines.....

it makes one appear and its about 25 feet off the ground......

any ideas

link: http://publicfiles.armedassault.info/ProjectRACS/dispenser.sqf

_cluster = _this select 0;
_abwurfhohe = _this select 1;
_canexplode=False;
_pos = [0,0,0];
_dir=0;
_ammo = ["MineGeneric"];
if (_abwurfhohe>10) then {_canexplode=true;};
_mr=40;
if (_abwurfhohe>50) then {_mr=60;};
if (_abwurfhohe>150) then {_mr=120;};
if (_abwurfhohe>200) then {_mr=200;};
if (_abwurfhohe>250) then {_mr=350;};


if (_canexplode) then {
sleep 3.4;
_vel = velocity _cluster;
_pos = getpos _cluster;
deletevehicle _cluster;

_h1 = "PRACS_BLU97" createvehicle _pos;
_h1 setpos _pos;
_h1 setvelocity [(_vel select 0)+random 5-random 5,(_vel select 1)+random 5-random 5,(_vel select 2)];
_h1 setdir 180;
_h2 = "PRACS_BLU97" createvehicle _pos;
_h2 setpos _pos;
_h2 setvelocity [(_vel select 0)+random 5-random 5,(_vel select 1)+random 5-random 5,(_vel select 2)];

for [{_i=0},{_i<110},{_i=_i+1}] do {
_h = (_ammo select random(count(_ammo)-0.00001)) createvehicle _pos;
_h setvelocity [(_vel select 0)+random 20-random 20,(_vel select 1)+random 20-random 20,(_vel select 2)+random 5.0-random 5.0];
};
sleep 0.1;
_mt = "MineGeneric" createvehicle _pos;
_mt setvelocity [(_vel select 0),(_vel select 1),(_vel select 2)];
_mtpos=[];
while {alive _mt} do {
_mtpos = getpos _mt;
sleep 0.01;
};
sleep 0.1;
for [{_i=0},{_i<(20+random 10)},{_i=_i+1}] do {
_m = "MineGeneric" createvehicle [0,0,0];
_m setpos [(_mtpos select 0)+random _mr-random _mr,(_mtpos select 1)+random _mr-random _mr,0.04] 
};

} else {
while {alive _cluster} do {
_pos = getpos _cluster;
_dir = getdir _cluster;
sleep 0.1;
};
_h = "MineGeneric" createvehicle [_pos select 0,_pos select 1,0.6];
_h setpos [_pos select 0,_pos select 1,0.6];
_h setdir _dir;
};

Share this post


Link to post
Share on other sites

I couldn't createvehicle a "MineGeneric" object; Arma whines about a missing config property for that object. Not aware I messed with any config myself there.

Anyway, I used the good ole "Mine" or "MineE" objects. Problem seems to be that these Mines are not configured to assume any 3d properties like gravity or velocity. Once you created them they just stay right there, never mind x,y or z. They won't move a bit and commands such as "Setvelocity" have no effect on them.

The only solution I could think of would be to use a similar looking object (that accepts velocity and gravity) and replace it by a mine once it hits the ground.

Regards,

VictorFarbau

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  

×