Thread: emitters
View Single Post
  #8  
Old 06-26-2006, 09:05 PM
_Z3phyr_ _Z3phyr_ is offline
Banned
Join Date: Sep 2003
Location: Louisiane
Posts: 390
_Z3phyr_ is an unknown quantity at this point
To control the movement, you can:

use the zangle to make all particle movement upwards (set it to emitter.particle.zangle = 1; ) or downwards (-1).

use 'speed' to control the rate the particles move in whatever dir it is (emitter.particle.speed = x; at x tiles/second).



And there's other stuff too, but from what I was told Stefan made this weapon NPC so I'm sure it may help you. This code is for a falling leaves effect:

PHP Code:
     // Falling leaves

          // Emitter attributes
          
layer = 2;
          
emitter.delaymin = 0.1;
          
emitter.delaymax = 0.3;
          
emitter.nrofparticles = 2;
          
emitter.emissionoffset = {0, -5, 10};
          
emitter.checkbelowterrain = true;

          
// Basic particle attributes
          
emitter.particle.lifetime = 10;
          
emitter.particle.image = "g4_particle_leaf.png";

          
// Movement
          
emitter.particle.zangle = -1;
          
emitter.particle.speed = 2;
          
emitter.particle.alpha = 0.75;
          
emitter.particle.mode = 1;

          
emitter.addglobalmodifier("impulse", 0.2, 0.2, "zangle", "multiply", 0.95, 0.95);
          
emitter.addlocalmodifier("once", 0, 0, "rotation", "replace", 0, 2*pi);
          
emitter.addlocalmodifier("once", 0, 0, "angle", "replace", degtorad(200), degtorad(260));
          
emitter.addlocalmodifier("once", 0, 0, "x", "add", -10, 25);
          
emitter.addlocalmodifier("once", 0, 0, "zoom", "replace", 0.6, 1.2);
          
emitter.addlocalmodifier("once", 0, 0, "green", "replace", 0.5, 1);
          
emitter.addglobalmodifier("impulse", 0.2, 0.2, "spin", "multiply", 0.6, 0.6);
          
emitter.addlocalmodifier("range", 0, 100000, "speed", "add", 3, 3);
          
with (emitter.addlocalmodifier("impulse", 1, 2, "spin", "add", -20, -30)) {
            
addmod("zangle", "add", 0.1, 0.5);
          } 
Reply With Quote