Game Development Community

Simple box for particle emitter

by Sam3d · in General Discussion · 09/19/2004 (12:05 pm) · 11 replies

Does anyone have a simple box.dts or empty.dts or something similar they could post?


I need to move a particle emitter across terrain.

Was thinking that replacing the buggy model with a box with transparent texture and then using vehicle code would be the easiest approach... ?

#1
09/19/2004 (11:40 pm)
Solved this, sorta, by using AiPlayer, scaling it way down and stripping out
everything I could, and enlarging the puff emitter.

Looks not bad, but what a hassle :)
#2
09/20/2004 (6:02 am)
Can you not just create a node and move it around the map? I've never tried to move a node, but I don't see why it couldn't be done unless you are trying to follow a path like the AI does.
#3
09/20/2004 (8:22 am)
I would love to use that approach, but not sure how to do it.

And, I thought particle emitters could only be attached to players, vehicles, projectiles.... unless they are stationary.
#4
09/20/2004 (9:23 pm)
Here is a complete emitter set (from chimneyFire.cs)...

datablock ParticleData(ChimneySmoke)
{
   textureName          = "Shared/Particles/smoke";
   dragCoefficient     = 0.0;
   gravityCoefficient   = -0.2;   // rises slowly
   inheritedVelFactor   = 0.00;
   lifetimeMS           = 3000;
   lifetimeVarianceMS   = 250;
   useInvAlpha = false;
   spinRandomMin = -30.0;
   spinRandomMax = 30.0;

   colors[0]     = "0.6 0.6 0.6 0.1";
   colors[1]     = "0.6 0.6 0.6 0.1";
   colors[2]     = "0.6 0.6 0.6 0.0";

   sizes[0]      = 0.5;
   sizes[1]      = 0.75;
   sizes[2]      = 1.5;

   times[0]      = 0.0;
   times[1]      = 0.5;
   times[2]      = 1.0;
};

datablock ParticleEmitterData(ChimneySmokeEmitter)
{
   ejectionPeriodMS = 20;
   periodVarianceMS = 5;

   ejectionVelocity = 0.25;
   velocityVariance = 0.10;

   thetaMin         = 0.0;
   thetaMax         = 90.0;  

   particles = ChimneySmoke;
};

datablock ParticleEmitterNodeData(ChimneySmokeEmitterNode)
{
   timeMultiple = 1;
};


And here are the eligable functions for the EmitterNode....


clearScopeToClient() - 
  delete() - 
  dump() - 
  getClassName() - 
  getDataBlock() - 
  getForwardVector() - 
  getGhostID() - 
  getGroup() - 
  getId() - 
  getName() - 
  getObjectBox() - 
  getPosition() - 
  getScale() - 
  getTransform() - 
  getType() - 
  getWorldBox() - 
  getWorldBoxCenter() - 
  save() - 
  schedule() - 
  scopeToClient() - 
  setDataBlock() - 
  setEmitterDataBlock() - 
  setName() - 
  setScale() - 
  setScopeAlways() - 
  setTransform() -
#5
09/21/2004 (7:37 am)
Yes, that was the first thing I tried...

They may be eligible functions, but some have no effect.

Try using setTransform() to move a ParticleEmitterNode.

You can see values incrementing via getTransform, but visually the ParticleEmitterNode does not move.
#6
09/21/2004 (10:50 am)
LOL, last night after I posted that, I went and played with the emitters for a while. A lot of those functions do nothing as a matter of fact. I'm tempted to look into it, but there has been talk of some big changes coming to the particle engine to soup it up. Not sure what the status on that is.


EDIT: I think it's pretty safe to say that if you want an emitter to move, it's going to have to be stuck to a moving object for now. The question is, what are you trying to do with this emitter? If I had just a rough idea on what type of movement you are hoping to achieve, I could probably help you a lot more and a lot faster.
#7
09/21/2004 (11:17 am)
Looking forward to the particle engine changes.


Creating a sorta ghost that wanders the terrain.

The method I described works, but... I only use observer camera.

And player.cc needed tweaking to raise up the puff emitter.
#8
09/21/2004 (1:25 pm)
For simple testing purposes, try using /shapes/markers/octahedron.dts
You can scale this so its not the massive globe it is for player spawns.
#9
09/21/2004 (1:49 pm)
Yeah, I tried that... crashed the engine.

Maybe there was an animation call or something I forgot to comment out.
#10
09/21/2004 (1:50 pm)
Yeah, I tried that... crashed the engine.

Maybe there was an animation call or something I forgot to comment out.
#11
09/21/2004 (2:49 pm)
ParticleEmitterNodes can be moved, as a matter of fact, vehicles do just that, update the position of the emitter every tick, so you might want to check how it's doing it, you might need an update method or something after setting the transform.