Author Topic: Continuous Radius Damage help  (Read 515 times)

I'm having problems with a script. It should be damaging a player when it goes into the radiusdamage but when the projectile explodes and the player isn't in the radius damage area, it doesn't work.

Code: [Select]
function MolotovroostertailProjectile::radiusDamage(%this, %obj, %col, %distanceFactor, %pos, %damageAmt)
{
   //validate distance factor
   if(%distanceFactor <= 0)
      return;
   else if(%distanceFactor > 1)
      %distanceFactor = 1;

   %damageAmt *= %distanceFactor;

   if(%damageAmt)
   {
      //use default damage type if no damage type is given
      %damageType = $DamageType::Radius;
      if(%this.RadiusDamageType)
         %damageType = %this.RadiusDamageType;

      %col.damage(%obj, %pos, %damageAmt, %damageType);
  echo("test");
   continuousDamage(%obj,%pos,%this.damageRadius,%this.radiusDamage,"Fire",0,20000);
      //burn the player?
      if(%this.explosion.playerBurnTime > 0)
      {
         if(%col.getType() & ($TypeMasks::PlayerObjectType | $TypeMasks::CorpseObjectType))
         {
            //check for vehicle protection from burning
            %doBurn = true;
            if(%col.isMounted())
            {
               %mountData = %col.getObjectMount().getDataBlock();
               if(%mountData.protectPassengersBurn)
                  %doBurn = false;
            }

            if(%doBurn)
               %col.burn(%this.explosion.playerBurnTime * %distanceFactor);
         } 
      }
   }
}
function continuousDamage(%sourceObject, %position, %radius, %damage, %damageType, %impulse,%duration)
{
radiusDamage(%sourceObject, %position, %radius, %damage, %damageType, %impulse);
if (%duration<0) return;
schedule(500,0,"continuousDamage",%sourceObject, %position, %radius, %damage, %damageType, %impulse,%duration-500);
}
Can anyone help?

Strato needs help??? I don't know if this has anything to do with it, but did you define what %duration is? Or does it have a default meaning?