Author Topic: Problem with particle color.  (Read 750 times)

Here is the script, the particles should come out black, but they always come out a bright white. I based it off of the hate script, and I'm unable to find the problem.
Code: [Select]
//emote_hate.cs


function serverCmdKickPoof(%client)
{
if(isObject(%client.player))
%client.player.emote(KickPoofImage);
}

datablock ParticleData(KickPoofParticle)
{
dragCoefficient      = 8;
gravityCoefficient   = -0.2;
inheritedVelFactor   = 0.2;
constantAcceleration = 0.0;
lifetimeMS           = 1000;
lifetimeVarianceMS   = 800;
textureName          = "base/data/particles/cloud";
spinSpeed = 10.0;
spinRandomMin = -50.0;
spinRandomMax = 50.0;
   colors[0]     = "0.2 0.2 0.2 0.5";
   colors[1]     = "0.0 0.0 0.0 1.0";
   colors[2]     = "0.0 0.0 0.0 0.0";
sizes[0]      = 4.25;
sizes[1]      =5.0;
   times[0]      = 0.0;
   times[1]      = 0.2;
   times[2]      = 1.0;
};

datablock ParticleEmitterData(KickPoofEmitter)
{
   ejectionPeriodMS = 5;
   periodVarianceMS = 0;
   ejectionVelocity = 7.0;
   ejectionOffset   = 0.2;
   velocityVariance = 0.5;
   thetaMin         = 0;
   thetaMax         = 10;
   phiReferenceVel  = 0;
   phiVariance      = 360;
   overrideAdvance = false;
   particles = "KickPoofParticle";

   uiName = "Emote - KickPoof";
};
datablock ShapeBaseImageData(KickPoofImage)
{
   shapeFile = "base/data/shapes/empty.dts";
emap = false;

mountPoint = $Hip;
   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] = 0.350;
stateEmitter[1] = KickPoofEmitter;
stateEmitterTime[1] = 0.350;

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

In the KickPoofParticle dataBlock you need to set useInvAlpha to true then fiddle with your color settings to get it right.