Jump to content
Sign in to follow this  
mallow234

Impact-detonated grenades

Recommended Posts

I've been trying to create a https://en.wikipedia.org/wiki/No._73_Grenade, and I've run into difficulties finding ways to make the grenade detonate on impact with the ground. Snooping around in configs has produced no results thus far, and I don't even know if it's possible to create impact-detonated grenades as all the ones I've found seem to be of the time-delayed variety. If anyone can supply me with a config entry that makes grenades detonate on impact, it would be helpful!

Share this post


Link to post
Share on other sites

could do it to a simple - _objgrenade = getPosATL player

_obj setPosATL [ getPosATL _obj select 0, getPosATL _obj select 1, getPosATL _obj select 3];

​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ â€‹ â€‹ â€‹ x y z

 

EX:

_x =  getPosATL _objgrenade select 0;
_y =  getPosATL _objgrenade select 1;
_z =  getPosATL _objgrenade select 2;

(its so early here so ima try, think Z is the upward direction)
if (_z == 0 || _z < 0) then 
{
 _objgrenade setDamage 1;


(if you dont got an explosion script)
_SFXEXPLO = "SmallSecondary";

_sfx = _SFXEXPLO createVehicle [getPosATL _objgrenade select 0, getPosATL _objgrenade select 1, (getPosATL _objgrenade select  2)];


};

This is just something i used for something similar to this, give it a try to try to use some ideas.

 

this could be run in a script - you config the grenade as an ordinary grenade then you can use this script to blow it up on ground contact.

 

also there may be a ground contact script that may be better than this (incase it hits a building or a wall of such)

 
ill try to help as much as i can!

Share this post


Link to post
Share on other sites

I actually found a different solution: I inherited from the 40mm GL grenades and made some alterations. I think it's the simulation entry in cfgAmmo that defines it, I believe if it's shotGrenade then it uses the explosionTime parameter and if it's shotShell then it'll detonate on impact. Thanks for the help though!

Share this post


Link to post
Share on other sites

Great to hear that you fixed your issue! 

 

possibly - share how you fixed it with code, so if other people find they run into this issue, it could help them too if you dont mind 

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  

×