Game Development Community

RadiusDamage not using impulse

by Ronald J Nelson · in Torque Game Engine · 06/29/2007 (12:47 am) · 2 replies

For some wierd reason I use radiusDamage for an explosion from a grenade and while it does apply damage just fine, it doesn't apply the impulse. I am just using the standard radiusDamage function.

I did try adding some echo statements to the portion that involved the impulse and this is the data I got. By the way I threw the grenade under the buggy.

This is %targetObject : 2517
This is %targetObject.getDataBlock().shapefile : main/data/shapes/items/tnt.dts
This is %position : 312.242 394.634 225.003
This is %impulseVec : -251.404 -126.917 413.145
This is %targetObject : 2313
This is %targetObject.getDataBlock().shapefile : main/data/shapes/vehicles/buggy/buggy.dts
This is %position : 312.242 394.634 225.003
This is %impulseVec : -368.986 162.897 295.489

As you can see it is definitely detecting the grenade and the vehicle, but they don't move.

#1
06/29/2007 (12:54 am)
Are you specifying an impulse amount when calling the function? Pending on your mass settings, you may need to specify up to 1000 for a noticeable result, sometimes a lot more.
function handGrenadeThrown::onDestroyed(%this, %obj, %lastState)
{
   %damage  = 50;
   %radius  = 10;
   %impulse = 100;
   %dmgType = "hand grenade";

   radiusDamage(%obj, %obj.getPosition(), %radius, %damage, %dmgType, %impulse);
   %obj.schedule(500, "delete");
}
#2
06/29/2007 (6:04 am)
Thanks it works at 1000.