Author Topic: Having More Than One Vehicle Emitter  (Read 661 times)

I have created another Vehicle as you can see in the attatchment below.
I have made a topic very similiar to this. What is the code for having Emitters to vehicles? My last attempt ended up with only Two emitters.

This is my Emitter Code.
Code: [Select]
datablock ParticleData(FireExhaustParticle)
{
   dragCoefficient      = 0;
   windCoefficient     = 0;
   gravityCoefficient   = 0;
   inheritedVelFactor   = 0.0;
   constantAcceleration = 0.0;
   spinRandomMin = -90;
   spinRandomMax = 90;
   lifetimeMS           = 500;
   lifetimeVarianceMS   = 0;
   textureName          = "base/data/particles/cloud";
   colors[0]     = "1 0 0 1";
   colors[1]     = "1 0.5 0 1";
   sizes[0]      = 0.6;
   sizes[1]      = 0.3;
};

datablock ParticleEmitterData(FireExhaustEmitter)
{
   ejectionPeriodMS = 1;
   periodVarianceMS = 0;
   ejectionVelocity = 0;
   velocityVariance = 0.0;
   ejectionOffset   = 0.0;
   thetaMin         = 0;
   thetaMax         = 180;
   phiReferenceVel  = 0;
   phiVariance      = 360;
   overrideAdvance = false;
   particles = "FireExhaustParticle";
};

datablock ShapeBaseImageData(FireExhaustImage1)
{
   shapeFile = "base/data/shapes/empty.dts";
emap = false;

mountPoint = 2;
   rotation = "1 0 0 -90";

stateName[0] = "Ready";
stateTransitionOnTimeout[0] = "FireA";
stateTimeoutValue[0] = 0.01;

stateName[1] = "FireA";
stateTransitionOnTimeout[1] = "Done";
stateWaitForTimeout[1] = True;
stateTimeoutValue[1] = 10000;
stateEmitter[1] = FireExhaustEmitter;
stateEmitterTime[1] = 10000;

stateName[2] = "Done";
stateScript[2] = "onDone";
};
function FireExhaustImage1::onDone(%this,%obj,%slot)
{
%obj.unMountImage(%slot);
}
datablock ShapeBaseImageData(FireExhaustImage2)
{
   shapeFile = "base/data/shapes/empty.dts";
emap = false;

mountPoint = 3;
   rotation = "1 0 0 -90";

stateName[0] = "Ready";
stateTransitionOnTimeout[0] = "FireA";
stateTimeoutValue[0] = 0.01;

stateName[1] = "FireA";
stateTransitionOnTimeout[1] = "Done";
stateWaitForTimeout[1] = True;
stateTimeoutValue[1] = 10000;
stateEmitter[1] = FireExhaustEmitter;
stateEmitterTime[1] = 10000;

stateName[2] = "Done";
stateScript[2] = "onDone";
};
function FireExhaustImage2::onDone(%this,%obj,%slot)
{
%obj.unMountImage(%slot);
}

datablock ShapeBaseImageData(FireExhaustImage3)
{
   shapeFile = "base/data/shapes/empty.dts";
emap = false;

mountPoint = 4;
   rotation = "1 0 0 -90";

stateName[0] = "Ready";
stateTransitionOnTimeout[0] = "FireA";
stateTimeoutValue[0] = 0.01;

stateName[1] = "FireA";
stateTransitionOnTimeout[1] = "Done";
stateWaitForTimeout[1] = True;
stateTimeoutValue[1] = 10000;
stateEmitter[1] = FireExhaustEmitter;
stateEmitterTime[1] = 10000;

stateName[2] = "Done";
stateScript[2] = "onDone";
};
function FireExhaustImage3::onDone(%this,%obj,%slot)
{
%obj.unMountImage(%slot);
}
datablock ShapeBaseImageData(FireExhaustImage4)
{
   shapeFile = "base/data/shapes/empty.dts";
emap = false;

mountPoint = 5;
   rotation = "1 0 0 -90";

stateName[0] = "Ready";
stateTransitionOnTimeout[0] = "FireA";
stateTimeoutValue[0] = 0.01;

stateName[1] = "FireA";
stateTransitionOnTimeout[1] = "Done";
stateWaitForTimeout[1] = True;
stateTimeoutValue[1] = 10000;
stateEmitter[1] = FireExhaustEmitter;
stateEmitterTime[1] = 10000;

stateName[2] = "Done";
stateScript[2] = "onDone";
};
function FireExhaustImage4::onDone(%this,%obj,%slot)
{
%obj.unMountImage(%slot);
}
datablock ShapeBaseImageData(FireExhaustImage5)
{
   shapeFile = "base/data/shapes/empty.dts";
emap = false;

mountPoint = 6;
   rotation = "1 0 0 -90";

stateName[0] = "Ready";
stateTransitionOnTimeout[0] = "FireA";
stateTimeoutValue[0] = 0.01;

stateName[1] = "FireA";
stateTransitionOnTimeout[1] = "Done";
stateWaitForTimeout[1] = True;
stateTimeoutValue[1] = 10000;
stateEmitter[1] = FireExhaustEmitter;
stateEmitterTime[1] = 10000;

stateName[2] = "Done";
stateScript[2] = "onDone";
};
function FireExhaustImage5::onDone(%this,%obj,%slot)
{
%obj.unMountImage(%slot);
}

function FireExhaustCheck(%obj)
{
// return;
if(!isObject(%obj))
return;

%speed = vectorLen(%obj.getVelocity());
if(%speed < %obj.dataBlock.minFireExhaustSpeed)
{
if(%obj.getMountedImage(5) !$= "")
{
%obj.unMountImage(1);
%obj.unMountImage(2);
%obj.unMountImage(3);
%obj.unMountImage(4);
%obj.unMountImage(5);
}
}
else
{
if(%obj.getMountedImage(6) $= 0)
{
%obj.mountImage(FireExhaustImage1,2);
%obj.mountImage(FireExhaustImage2,3);
%obj.mountImage(FireExhaustImage3,4);
%obj.mountImage(FireExhaustImage4,5);
%obj.mountImage(FireExhaustImage5,6);
}
}

if(%speed < 1)
{
if(%obj.prop !$= "slow")
{
%obj.playThread(0,propslow);
%obj.prop = "slow";
}
}
else
{
if(%obj.prop !$= "fast")
{
%obj.playThread(0,propfast);
%obj.prop = "fast";
}
}

schedule(2000,0,"FireExhaustCheck",%obj);
}


Red = Not Emitter Joint
Green = Emitter Joint


This is working in Game atleast.
« Last Edit: November 14, 2010, 10:47:45 AM by Uxie »