Jump to content
Sign in to follow this  
helling3r

Make mortar simulate fire (effects only)

Recommended Posts

Hi,

i am searching for a way to mimic the firing effect of a mortar.

I only need the sound; but it would be cool also to have the muzzle effects.

- sounds: i know how to play it, but i lack a list showing me the right name of the sound to play.

- effects: i had no success using various instances of the "fire" and "action" commands. How can i play the effect of the mortar being fired?

It is the ACE 60mm US mortar.

Share this post


Link to post
Share on other sites

To delete the projectile:

_mortar addEventHandler ["fired", {deleteVehicle (_this select 6);}];

If you want the AI to fire:

_mortar action ["useWeapon", _mortar, (gunner _mortar),0];

nul = [_mortarName, 3] execVM "mortar.sqf";

_mortar = _this select 0;
_rounds = _this select 1;

for "_i" from 0 to (_rounds-1) do {
if (count (magazines _mortar) <= 2) then {{_mortar addMagazine "8Rnd_81mmHE_M252"} forEach [1,2,3]; hint "mortar reloaded";};
_mortar action ["useWeapon", _mortar, (gunner _mortar),0];
sleep 6;
};

Edited by Mattar_Tharkari

Share this post


Link to post
Share on other sites

Okay by principle it works very well. However, it seems that the shell explodes directly after the round was shot, killing the gunner. :(

Share this post


Link to post
Share on other sites

That did the trick, thank you!

// in the event handler:
(_this select 6) setPos [0,0,-1000];
deleteVehicle (_this select 6);

Share this post


Link to post
Share on other sites
Okay by principle it works very well. However, it seems that the shell explodes directly after the round was shot, killing the gunner. :(

Really? Works for me? Where did you put the event handler?

Share this post


Link to post
Share on other sites

The event handler is initialized from the script that deploys the mortar.

The shell is now moved to [0,0,5000] and then deleted instantly. This fixes the problem of the exploding shell when the event handler fired.

Share this post


Link to post
Share on other sites

It should be:

_EH     = _mortar addEventHandler ["fired", {deletevehicle (nearestobject[_this select 0, _this select 4])}];

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  

×