Author Topic: Destroy bricks at a radius  (Read 1755 times)

This code doesnt seem to work. Its sapose to Destroy bricks at a radius. Can anyone help? Ill give  :cookie: s to charity if you do! If you dont a   :panda: dies.

Code: [Select]
package killradius
{
function BulldozergunProjectile::radiusDamage(%this, %obj, %col, %distanceFactor, %pos, %damageAmt)
{
  if(%col.getClassName() $= "fxDTSBrick"){
   %col.killBrick();
   }
   //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);

      //burn the player?
      if(%this.explosion.playerBurnTime > 0)
      {
         if(%col.getType() & $TypeMasks::PlayerObjectType)
         {
            %col.burn(%this.explosion.playerBurnTime * %distanceFactor);
         }
      }
   }
}
};
activatePackage(killradius);


« Last Edit: July 02, 2008, 06:45:07 PM by Kunit_Yo »

I don't know the code for killing bricks, but can I ask you a question?
Why is this in a package?

I don't know the code for killing bricks, but can I ask you a question?
Why is this in a package?
He's overwriting ::radiusDamage


I don't know the code for killing bricks, but can I ask you a question?
Why is this in a package?
He's overwriting ::radiusDamage
You could overwrite it without a package, as long as he isn't adding it to the original code with Parent::

You don't even need all of that script unless you're gonna burn people with this gun.

Does %obj.killBrick(); even work?

No, idea Rky said it did.

%obj.kill?

%obj.fakekill

or even possibly %obj.fakekill(%time):

I have no idea lol.

Does %obj.killBrick(); even work?
That destroys bricks as if they've been hit with the Admin Wand, permanently...

I think %obj.fakeKill(time) is only in v9.

If you want them to be killed rather than "exploded" like minigames then you should use a radius search in the onCollision for $TypeMasks::FXBrickObjectType using %obj.killBrick(). If you want temporary damage, just use the built in brick damage functions:
Code: [Select]
datablock ProjectileData(rocketLauncherProjectile)
{
  ...
   brickExplosionRadius = 3;
   brickExplosionImpact = false;          //destroy a brick if we hit it directly?
   brickExplosionForce  = 30;             
   brickExplosionMaxVolume = 30;          //max volume of bricks that we can destroy
   brickExplosionMaxVolumeFloating = 60;  //max volume of bricks that we can destroy if they aren't connected to the ground (should always be >= brickExplosionMaxVolume)
  ...
};

Well i want it to perma kill the brick

Peace check your PM box I sent you some code not shure if it will work though.
« Last Edit: July 06, 2008, 01:32:12 AM by Kunit_Yo »

It helps the community more if you actually post the code here, then we can all check it, discuss it and use it in future if we need to.