natanbrody 10 Posted July 16, 2013 Hey Guys I have another one for you!!! Any Ideas on how i can get "mortar fire" that seems unendless that hits always at ranges from 10m to 50m from the player wherever he is. They could just be explosions not actual mortars. Share this post Link to post Share on other sites
kylania 568 Posted July 16, 2013 Here's what I used in ArmA2, based on the script in one of the BAF missions. init.sqf: mortarFalling = FALSE; _mortars = [m1,m2,m3]; {[getPos player, _x, observer, true] execVM "mortars.sqf"} forEach _mortars; // using optional player tracking mortars.sqf: _targetPos = _this select 0; _mortar = _this select 1; _observer = _this select 2; _tracking = if (count _this > 3) then {_this select 3} else {false}; // Optional tracking, added by kylania _observerCoef = 1; //while {alive gunner _mortar} do { while {mortarsActive} do { if (_tracking) then {_targetPos = getPos (vehicle player)}; // Optional tracking, added by kylania if (!(alive _observer)) then {_observerCoef = 3}; _randomPos = [_targetPos, (random 150) * _observerCoef, random 360] call BIS_fnc_relPos; {if (_randomPos distance _x < 5) then {_randomPos = [position _x, 5, random 360] call BIS_fnc_relPos}} forEach units player; impactArea setPos _randomPos; mortarFalling = TRUE; publicVariable "mortarFalling"; sleep 1.75; _shell = "Sh_85_AP" createVehicle _randomPos; mortarFalling = FALSE; publicVariable "mortarFalling"; sleep ((15 + random 15) * _observerCoef) }; Might need to switch the shell class to an ArmA3 one. Share this post Link to post Share on other sites
natanbrody 10 Posted July 16, 2013 is it possible to put it in a trigger? Share this post Link to post Share on other sites