I am wanting give my projectiles some different partical emmitters!

I am wanting give my projectiles some different partical emmitters, depending on if they hit terrain or an Interior,
The function below is buggy, does not work all the time..
Doing a terrain search was always easy for deployables, but on projectile collision, its a bit strange.
If there are any coding gods still here, any help would be apreciated. ;)
function DiscProjectile::onCollision(%data, %projectile, %targetObject, %modifier, %position, %normal)
{
   echo("\n--------- ( DiscProjectile::onCollision ) ---------");
   %masks = $TypeMasks::TerrainObjectType;
   %detectRange = 5;
   InitContainerRadiusSearch(%position, %detectRange, %masks);
   while((%targetObject = containerSearchNext()) != 0)
   if(%targetObject){
   echo("\n--------- ( dirt effect ) ---------");
   %dirtEffect1 = new ParticleEmissionDummy(){
      position = %position;
      dataBlock = "defaultEmissionDummy";
      emitter = "RocketDirtBurstEmitter";
   };
   MissionCleanup.add(%dirtEffect1);
   %dirtEffect1.schedule(1000, delete);

   %dirtEffect2 = new ParticleEmissionDummy(){
      position = %position;
      dataBlock = "defaultEmissionDummy";
      emitter = "RocketDirtSparksEmitter";
   };
   MissionCleanup.add(%dirtEffect2);
   %dirtEffect2.schedule(1000, delete);
   }
   else
   {
   echo("\n--------- ( no dirt effect ) ---------");
   }

   if(isObject(%targetObject)) // z0dd - ZOD, 4/24/02. Console spam fix.
   {
      %targetObject.damage(%projectile.sourceObject, %position, %data.directDamage * %modifier, %data.directDamageType);
   }

}



Comments

Sign In or Register to comment.