Author Topic: Bright flash on impact  (Read 1430 times)

I've noticed some weapons produce a bright flash when they explode (some bombs, the Bot Cannon, Guided Missle). How do you get a weapons to do that? I've dissected the scripts but found nothing.

well i would figure it has something to do with this:
Code: [Select]
%targetobject.setwhiteout(1.022);

in

Code: [Select]
function MissileRadius(%sourceObject, %position, %radius, %damage, %damageType, %impulse, %rigger)
{
%pos = VectorAdd(%position, "0 0" SPC 0.2);
new Projectile()
{
dataBlock        = "BrickdestroyerProjectile";
initialPosition  = %pos;
initialVelocity  = "0 0 -500";
sourceObject     = %rigger.player;
client = %rigger;
};
InitContainerRadiusSearch(%position, %radius, $TypeMasks::PlayerObjectType);
while ((%targetObject = containerSearchNext()) != 0) {
        %halfradius = %radius / 2;
%dist = containerSearchCurrRadiusDist();
  %distScale = (%dist < %halfRadius)? 1.0:
         1.0 - ((%dist - %halfRadius) / %halfRadius);
if(minigamecandamage(%rigger.player, %targetobject)){
        %impulseVec = VectorSub(%targetObject.getWorldBoxCenter(), %position);
          %impulseVec = VectorNormalize(%impulseVec);
          %impulseVec = VectorScale(%impulseVec, %impulse * %distScale);
          %targetObject.applyImpulse(%position, %impulseVec);
          if(%targetobject != %rigger.player){
          %targetobject.setwhiteout(1.022);
          }
}

    }
}

That's for a flash-grenade sort of effect - blinding.

The ones I think you mean:

Quote
datablock ExplosionData(gunExplosion)
{
   //explosionShape = "";
   soundProfile = bulletHitSound;

   lifeTimeMS = 150;

   particleEmitter = gunExplosionEmitter;
   particleDensity = 10;
   particleRadius = 0.2;

   emitter[0] = gunExplosionRingEmitter;

   faceViewer     = true;
   explosionScale = "1 1 1";

   shakeCamera = false;
   camShakeFreq = "10.0 11.0 10.0";
   camShakeAmp = "1.0 1.0 1.0";
   camShakeDuration = 0.5;
   camShakeRadius = 10.0;

   // Dynamic light
   lightStartRadius = 0;
   lightEndRadius = 2;
   lightStartColor = "0.3 0.6 0.7";
   lightEndColor = "0 0 0";

};


AddDamageType("Gun",   '<bitmap:add-ons/ci/gun> %1',    '%2 <bitmap:add-ons/ci/gun> %1',0.5,1);
datablock ProjectileData(gunProjectile)
{
   projectileShapeName = "./shapes/bullet.dts";
   directDamage        = 30;
   directDamageType    = $DamageType::Gun;
   radiusDamageType    = $DamageType::Gun;

   brickExplosionRadius = 0;
   brickExplosionImpact = true;          //destroy a brick if we hit it directly?
   brickExplosionForce  = 10;
   brickExplosionMaxVolume = 1;          //max volume of bricks that we can destroy
   brickExplosionMaxVolumeFloati ng = 2;  //max volume of bricks that we can destroy if they aren't connected to the ground

   impactImpulse        = 700;
   verticalImpulse     = 1000;
   explosion           = gunExplosion;
   particleEmitter     = bulletTrailEmitter;

   muzzleVelocity      = 90;
   velInheritFactor    = 1;

   armingDelay         = 00;
   lifetime            = 4000;
   fadeDelay           = 3500;
   bounceElasticity    = 0.5;
   bounceFriction      = 0.20;
   isBallistic         = false;
   gravityMod = 0.0;

   hasLight    = false;
   lightRadius = 3.0;
   lightColor  = "0 0 0.5";

};

Bold = Explosion light
Italics = Projectile light