BMAP* smoke_tga = "laser_grey.tga";
//// particle alpha handling ////////
function fire_part_alphafade(PARTICLE *p)
{
p.alpha = p.lifespan -= time_step;
}
///// particle creating /////////
function effect_fire(PARTICLE *p)
{
p.vel_x = random(20)-10;
p.vel_y = random(20)-10;
p.vel_z = -40;
p.x += random(1000)-500;
p.y += random(1000)-500;
p.z += random(100)-50;
p.lifespan = 100; // has to be adapted
p.alpha = 100;
p.bmap = smoke_tga;
p.red = p.blue = p.green = 128;
p.size = 14;
p.flags |= (TRANSLUCENT | MOVE);
p.event = fire_part_alphafade;
}
//// particle using /////////
const var RAIN_COUNT = 1;
action im_on_fire()
{
set(my, INVISIBLE | PASSABLE);
while(1)
{
VECTOR temp;
vec_set(temp, camera.x);
temp.z += 600;
effect(effect_fire, maxv(1, integer(RAIN_COUNT*time_step)), temp, nullvector);
wait(1);
}
}
as for the lifespan, try to adapt it to your needs. i wasn't sure what you were trying to achieve so i just made the particle kind of like rain.
i haven't tested the code.
some general tips: try to write more compact code. try not to mix stuff which does the same thing (such as set and .flags) - just stick to one which fits your needs. don't mix English and German in variable names, use "const" for constants and write them in large letters. structurize your code with empty lines. and of course: "if you can say it with code, code, else comment" (which means that unnecessary comments don't add to the clearness of your code).
joey.