Game Development Community

Explosion problem

by Ronald J Nelson · in Torque Game Engine · 11/13/2007 (4:31 pm) · 4 replies

Could someone please tell me why this explosion isn't working or visible?

datablock ParticleData(collisionSparks) {
   canSaveDynamicFields = "1";
   dragCoefficient = "0.997067";
   windCoefficient = "1";
   gravityCoefficient = "-0.002442";
   inheritedVelFactor = "0.199609";
   constantAcceleration = "0";
   lifetimeMS = "480";
   lifetimeVarianceMS = "320";
   spinSpeed = "0";
   spinRandomMin = "0";
   spinRandomMax = "0";
   useInvAlpha = "0";
   animateTexture = "0";
   framesPerSec = "1";
   textureName = "main/data/fx/particles/spark";
   animTexName[0] = "main/data/fx/particles/spark";
   colors[0] = "1 1 1 1";
   colors[1] = "1 1 1 1";
   colors[2] = "1 1 1 1";
   colors[3] = "1 1 1 1";
   sizes[0] = "0.03";
   sizes[1] = "0.03";
   sizes[2] = "0.03";
   sizes[3] = "1";
   times[0] = "0";
   times[1] = "0.5";
   times[2] = "1";
   times[3] = "1";
   allowLighting = "1";
};

datablock ParticleEmitterData(collisionSparkEmitter)
{
   ejectionPeriodMS = 3;
   periodVarianceMS = 0;
   ejectionVelocity = 5;
   velocityVariance = 1;
   ejectionOffset   = 0.0;
   thetaMin         = 0;
   thetaMax         = 180;
   phiReferenceVel  = 0;
   phiVariance      = 360;
   overrideAdvances = false;
   orientParticles  = true;
   lifetimeMS       = 100;
   particles = "collisionSparks";
};

datablock ExplosionData(collisionExplosion)
{
   // Volume particles
   particleEmitter = collisionSparkEmitter;
   particleDensity = 1;
   particleRadius = 0.01;
   
   // Camera Shaking
   shakeCamera = true;
   camShakeFreq = "10.0 11.0 10.0";
   camShakeAmp = "1.0 1.0 1.0";
   camShakeDuration = 0.5;
   camShakeRadius = 10.0;
   
   // Impulse
   impulseRadius = 10;
   impulseForce = 15;
};

#1
11/13/2007 (5:18 pm)
Need a collisionExplosionNode....
#2
11/13/2007 (7:09 pm)
Nope other explosions work just fine when used with my code, just this one isn't.
#3
11/14/2007 (1:11 am)
Check the console log to make sure the script can find the explosion shape and that there are no errors related to the explosion.
#4
11/14/2007 (3:49 am)
Also make sure the Explosion is included in the scripts before you actually assign it. So in a vehicle script file it shuold be added to the top of the file, not the bottom. Or include the file it's in at the top of the vehicle file.