Author Topic: More than one Particle  (Read 1275 times)

Just a little doubt, can you put more than one particle for a emmiter?

Like:

Code: [Select]
datablock ParticleEmitterData(Unusual_BullpupTrailEmitter)
{
   ejectionPeriodMS = 2;
   periodVarianceMS = 0;

   ejectionVelocity = 0; //0.25;
   velocityVariance = 0; //0.10;

   ejectionOffset = 0;

   thetaMin         = 0.0;
   thetaMax         = 90.0; 

   particles = Unusual_BullpupTrailParticle
   particles[2] = Unusual_BullpupTrailParticle2

   useEmitterColors = true;
};
Thanks.

Just a little doubt, can you put more than one particle for a emmiter?

Like:

Code: [Select]
datablock ParticleEmitterData(Unusual_BullpupTrailEmitter)
{
   ejectionPeriodMS = 2;
   periodVarianceMS = 0;

   ejectionVelocity = 0; //0.25;
   velocityVariance = 0; //0.10;

   ejectionOffset = 0;

   thetaMin         = 0.0;
   thetaMax         = 90.0; 

   particles = Unusual_BullpupTrailParticle
   particles[2] = Unusual_BullpupTrailParticle2

   useEmitterColors = true;
};
Thanks.
As far as i know, not like that.
However, i noticed the following in the torque reference guide:
Quote from:  Torque reference guide "Particle Emitter Data, Particle"
String containing a tab-delimited list of ParticleData datablock names. When a
particle is emitted from the emitter, its datablock is randomly selected from the
list of valid datablocks supplied in the particles field string. The string must be
non-empty and at least one token must evaluate to a valid ParticleData datablock
name. String must also be less than 256 characters long. If either of these
conditions is not met, a console warning will be produced and the datablock's
onAdd() method will fail.
So probably, you could use:
   particles = "Unusual_BullpupTrailParticle   Unusual_BullpupTrailParticle2";
Note that i haven't tested the above statement.
Also don't forget about the last character on the above line (;), as i noticed you missed that in your code you pasted.


Thanks, i'll try it!
Inform me of the result, i am not happy with my answer as i haven't tested it. :C

Inform me of the result, i am not happy with my answer as i haven't tested it. :C
Didn't work. :C


You can't that way, you would have to pass both particles through the function. Try calling the function twice with both particles? Or within the function.
1.
datablock ParticleEmitterData(Unusual_BullpupTrailEmitter)
{...}
datablock ParticleEmitterData(Unusual_BullpupTrailEmitter2)
{...}

Or

2.
datablock ParticleEmitterData(Unusual_BullpupTrailEmitter)
{
  ...
     datablock ParticleEmitterData(Unusual_BullpupTrailEmitter2)
     {...}
 ...
}



Also not tested, hope it works though.

-Snip-
You cant have a datablock inside a datablock?
Its like having a function inside a function?

You can't that way, you would have to pass both particles through the function. Try calling the function twice with both particles? Or within the function.
1.
datablock ParticleEmitterData(Unusual_BullpupTrailEmitter)
{...}
datablock ParticleEmitterData(Unusual_BullpupTrailEmitter2)
{...}

Or

2.
datablock ParticleEmitterData(Unusual_BullpupTrailEmitter)
{
  ...
     datablock ParticleEmitterData(Unusual_BullpupTrailEmitter2)
     {...}
 ...
}



Also not tested, hope it works though.
A datablock thing is not a function.
And both can't be made inside themselves.
You cant have a datablock inside a datablock?
Its like having a function inside a function?
However, you have to make sure both datablocks exist.
But that's not done by that.

Khain, is it working yet, if no?
If no, any console errors?

Otherwise you will have to do it on a more or less hacky way.

particles = "Unusual_BullpupTrailParticle         Unusual_BullpupTrailParticle2";
particles = "Unusual_BullpupTrailParticle\tUnusual_BullpupTrailParticle2";

particles = "Unusual_BullpupTrailParticle\tUnusual_BullpupTrailParticle2";
Oh right, it doesn't do a normal tab right?
How silly.