Author Topic: Solved Animated fire not showing up in game  (Read 590 times)

I made animated fire for my server and it shows up in the emitter list but when i try to put it on a brick nothing happens

Code: [Select]
datablock particleData(AnimFlameFrame1)
{
textureName = "./frames/flame1.png";
};

datablock particleData(AnimFlameFrame2)
{
textureName = "./frames/flame2.png";
};

datablock particleData(AnimFlameFrame3)
{
textureName = "./frames/flame3.png";
};

datablock particleData(AnimFlameFrame4)
{
textureName = "./frames/flame4.png";
};

datablock particleData(AnimFlameFrame5)
{
textureName = "./frames/flame5.png";
};

datablock particleData(AnimFlameFrame6)
{
textureName = "./frames/flame6.png";
};

datablock particleData(AnimFlameFrame7)
{
textureName = "./frames/flame7.png";
};

datablock particleData(AnimFlameFrame8)
{
textureName = "./frames/flame8.png";
};

datablock particleData(AnimFlameFrame9)
{
textureName = "./frames/flame9.png";
};

datablock particleData(AnimFlameFrame10)
{
textureName = "./frames/flame10.png";
};

datablock particleData(AnimFlameFrame11)
{
textureName = "./frames/flame11.png";
};

datablock particleData(AnimFlameFrame12)
{
textureName = "./frames/flame12.png";
};

datablock particleData(AnimFlameFrame13)
{
textureName = "./frames/flame13.png";
};

datablock particleData(AnimFlameFrame14)
{
textureName = "./frames/flame14.png";
};

datablock particleData(AnimFlameFrame15)
{
textureName = "./frames/flame15.png";
};

datablock particleData(AnimFlameFrame16)
{
textureName = "./frames/flame16.png";
};

datablock particleData(AnimFlameFrame17)
{
textureName = "./frames/flame17.png";
};

datablock ParticleData(flameAniParticle) {

   dragCoefficient      = 0.0;
   gravityCoefficient   = 0.0;
   inheritedVelFactor   = 0.0;
   windCoefficient      = 0.0;
   constantAcceleration = 0.0;
   lifetimeMS           = 566;
   lifetimeVarianceMS   = 0;
   useInvAlpha          = false;
   textureName          = "./frames/flame1.png";

animTexName[0] = "./frames/flame1.png";
animTexName[1] = "./frames/flame2.png";
animTexName[2] = "./frames/flame3.png";
animTexName[3] = "./frames/flame4.png";
animTexName[4] = "./frames/flame5.png";
animTexName[5] = "./frames/flame6.png";
animTexName[6] = "./frames/flame7.png";
animTexName[7] = "./frames/flame8.png";
animTexName[8] = "./frames/flame9.png";
animTexName[9] = "./frames/flame10.png";
animTexName[10] = "./frames/flame11.png";
animTexName[11] = "./frames/flame12.png";
animTexName[12] = "./frames/flame13.png";
animTexName[13] = "./frames/flame14.png";
animTexName[14] = "./frames/flame15.png";
animTexName[15] = "./frames/flame16.png";
animTexName[16] = "./frames/flame17.png";

   animateTexture = true;
   framesPerSec = 30;

   colors[0]     = "1 1 1 0.7";
   colors[1]     = "1 1 1 0.7";
   sizes[0] = 1.0;
   sizes[1] = 1.1;
   times[0] = 0.0;
   times[1] = 1.0;
};

datablock ParticleEmitterData(flameAniEmitter)
{
   ejectionPeriodMS = 566;
   periodVarianceMS = 0;
   ejectionVelocity = 0.0;
   ejectionOffset   = 0.0;
   velocityVariance = 0.0;
   thetaMin         = 0;
   thetaMax         = 0;
   phiReferenceVel  = 0;
   phiVariance      = 0;
   overrideAdvance = false;
   orientParticles = true;
   lifeTimeMS = 100; //Usless

   particles = "flameAniParticle";

   uiName = "Flame Animated";
};

Edit: If you use orientparticles = true then you need to put a velocity or the particles wont show up
« Last Edit: July 14, 2021, 07:22:55 AM by Biqus »

Animated particles are difficult in Torque, but you don't need multiple particle datablocks if you're using the 'animateTexture' method

A way i've worked out animated particles is by referencing multiple particles in the emitter data
Code: [Select]
datablock ParticleData(shieldArcs1Particle)
{
   dragCoefficient      = 5.0;
   gravityCoefficient   = -0.0;
   inheritedVelFactor   = 0.0;
   constantAcceleration = 0.0;
   lifetimeMS           = 50;
   lifetimeVarianceMS   = 0;
   useInvAlpha          = false;
   textureName          = "./electric_arcs1";
   colors[0]     = "1 0.9 0.4 1";
   colors[1]     = "1 0.9 0.4 1";
   colors[2]     = "1 0.9 0.4 1";
   colors[3]     = "1 0.9 0.4 1";
   sizes[0]      = 1;
   sizes[1]      = 1;
   sizes[2]      = 1;
   sizes[3]      = 1;
   times[0]      = 0.0;
   times[1]      = 0.3;
   times[2]      = 0.7;
   times[3]      = 1.0;
};
datablock ParticleData(shieldArcs2Particle : shieldArcs1Particle)
{
   lifetimeMS           = shieldArcs1Particle.lifetimeMS;
   textureName          = "./electric_arcs2";
};
datablock ParticleData(shieldArcs3Particle : shieldArcs1Particle)
{
   lifetimeMS           = shieldArcs1Particle.lifetimeMS;
   textureName          = "./electric_arcs3";
};
datablock ParticleData(shieldArcs4Particle : shieldArcs1Particle)
{
   lifetimeMS           = shieldArcs1Particle.lifetimeMS;
   textureName          = "./electric_arcs4";
};

datablock ParticleEmitterData(shieldArcsEmitter)
{
   ejectionPeriodMS = 10;
   periodVarianceMS = 0;
   ejectionVelocity = 0;
   ejectionOffset   = 0;
   velocityVariance = 0;
   thetaMin         = 89;
   thetaMax         = 90;
   phiReferenceVel  = 0;
   phiVariance      = 360;
   overrideAdvance = false;
   particles = "shieldArcs1Particle" TAB "shieldArcs2Particle" TAB "shieldArcs3Particle" TAB "shieldArcs4Particle";
};

I tried to do it your way but, it put this error


It did get added to the emitter list when i changed it to use only a few of the frames but the fire still didnt appear

So fix what the error said was the problem and shorten the names of your particle datablocks so you can fit them in the emitter, try something like "animFlame#", or just "flame#"

Nevermind masterlegodude for some reason orientparticles = true will break your particle emitter and cause it to not emit anything at all but thank you for trying to help me
« Last Edit: July 13, 2021, 04:41:16 PM by Biqus »

Nevermind masterlegodude for some reason orientparticles = true will break your particle emitter and cause it to not emit anything at all
It doesn't, it might just be because your particles aren't going anywhere, so the engine doesn't know how to orient the particles

It doesn't, it might just be because your particles aren't going anywhere, so the engine doesn't know how to orient the particles
I tested this and you were right so if you use orientparticles = true then you need to put a velocity or the particles wont show up