Author Topic: Emitter on Vehicle Not Showing Up.  (Read 748 times)

So I'm trying to make a smoke effect from a muffler, so I took the script from the stunt plane, and chopped off the bits I needed for it, but when I tested it to make sure it shows up, it doesn't.
I use this:
Code: [Select]
datablock ParticleData(GoKartParticle)
{
   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 1 1 1";
   colors[1]     = "0.2 0.2 1 0";
   sizes[0]      = 0.1;
   sizes[1]      = 0.05;
};

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

datablock ShapeBaseImageData(GoKartImage1)
{
   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";
stateEmitter[1] = contrailEmitter;
stateEmitterTime[1] = 10000;

};
datablock ShapeBaseImageData(GoKartImage2)
{
    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";
stateEmitter[1] = contrailEmitter;
stateEmitterTime[1] = 10000;

};
It's in a separate script, but I have it so it's executed. What am I doing wrong?
Don't worry, it's not really a go kart. I just needed to hide the real name.

This is probably to do with the scripts and the emitters not mounting, please post the scripts.

The other scripts are just the basic jeep script with some changed values. I plan to do more to it, but I don't see how I need them to mount the emitter.

Look at the Stunt Plane.

I did. That's where I go the script from, but I didn't need it to appear at a certain speed, I need it going all the time.

Which bit of your script attaches GoKartImage1 and GoKartImage2 to your vehicle?

Code: [Select]
   shapeFile = "base/data/shapes/empty.dts";
emap = false;

mountPoint = 3;
   rotation = "1 0 0 -90";
?
I really don't know. I'm just guessing.

Quote
function ContrailImage2::onDone(%this,%obj,%slot)
{
   %obj.unMountImage(%slot);
}

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

   %speed = vectorLen(%obj.getVelocity());
   if(%speed < %obj.dataBlock.minContrailSpeed)
   {
      if(%obj.getMountedImage(3) !$= "")
      {
         %obj.unMountImage(2);
         %obj.unMountImage(3);
      }
   }
   else
   {
      if(%obj.getMountedImage(3) $= 0)
      {
         %obj.mountImage(contrailImage1,2);
         %obj.mountImage(contrailImage2,3);
      }
   }

   if(%speed < 5)
   {
      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,"contrailCheck",%obj);
}
That's the stunt plane version of what he means. Do you have that in yours?

I only need the part where it mounts it. I don't need it to unmount it.
Got it working.
« Last Edit: August 18, 2009, 04:31:10 PM by Azerath »

I only need the part where it mounts it. I don't need it to unmount it.
%obj.mountImage(imageName, slot);