GrenadeProjectileData, unable to call onCollision..

How come the BasicGrenade or even a second renamed grenade projectile has no working onCollision?
function BasicGrenade::onCollision(%data, %projectile, %targetObject, %modifier, %position, %normal){
   echo("\n--------- ( BasicGrenade::onCollision ) ---------");
   if(isObject(%targetObject)) {  // z0dd - ZOD, 4/24/02. Console spam fix.
   %targetObject.damage(%projectile.sourceObject, %position, %data.directDamage * %modifier, %data.directDamageType);
   }
   GrenadeLauncherFX(%data, %projectile, %targetObject, %modifier, %position, %normal);
}

Comments

  • Um... I never ran into that problem... :P Base or Classic,
  • I haven't checked for myself, but it's very possible (even likely) that whoever wrote the GrenadeProjectile update behaviour did not pass an onCollision call to the script system. Pre-arming collision handling of a GrenadeProjectile is just used for bouncing the projectile off of the hit surface, while post-armed collisions simply explode the projectile. Because a launched grenade/mortar was only ever used for a radius explosion, the thought of adding an onCollision call probably didn't occur to the person who wrote it.

    Were you hoping to get the collision data from a pre-arming bounce of the projectile, or looking to add an environment area-based explosion as in your previous thread? If the latter, you could add it in the datablock's GrenadeProjectile::onExplode function, but as it doesn't pass the colliding object you will in this case have to find the object.
  • edited July 2013
    I wanted it for my environment area-based explosion as in my last post..
    The seeking projectile has the same issue.. I will just half to forget about it for those 2 projectile types..
Sign In or Register to comment.