BMAP smoke_tga = "smoke.tga";
function fade_smoke()
{
my.alpha -= 0.15 * time; // particle fading speed
if (my.alpha < 0) {my.lifespan = 0;}
}
function smoke_effect()
{
my.bmap = smoke_tga;
temp.x = random(1) - 0.5; // move a bit on the x
temp.y = random(1) - 0.5; // and y axis
temp.z = random(2); // but always move upwards on the z axis
vec_add (my.vel_x, temp);
my.alpha = 10 + random(20);
my.size = 5; // size of the smoke
my.bright = on;
my.move = on;
my.lifespan = 50; // lifespan for the smoke particles
my.function = fade_smoke;
}
starter generate_smoke()
{
while (diamond == null) {wait (1);}
while (1)
{
vec_for_vertex (temp, diamond, 2617); // generate smoke from the 246th vertex on the player model
effect (smoke_effect, (2 / (time_step + 0.1)), temp.x, normal);
wait (1);
}
}