This is the projectile code
Code:
		bullet_speed.x = 100 * time_step; // adjust the speed of the bullet here

vec_set(pos1.x, my.x);
c_move(me, bullet_speed, nullvector, IGNORE_YOU|IGNORE_PASSABLE|IGNORE_FLAG2|ACTIVATE_SHOOT);
vec_set(pos2.x, my.x);
vec_sub(pos2.x, pos1.x);
pos2.x = pos2.x / time_step;
pos2.y = pos2.y / time_step;
pos2.z = pos2.z / time_step;

vec_inverse(pos2);


This is the particle, remove the remark with if use with 2nd method.
Code:
function tail(PARTICLE *p)
{
p.bmap = tail_image;
p.size = tail_size;
//set(p,BRIGHT|MOVE|BEAM);
set(p,BRIGHT|MOVE);
p.alpha = 100;
p.red = 50;
p.green = 255;
p.blue = 50;
p.gravity = 0;
p.lifespan = tail_life;
p.event = tail_func;
}

function tail_func(PARTICLE *p)
{
// erases the tail after a while
p.alpha = 100*(p.lifespan/tail_life);
}



Method 1:
If I compute the tail by manual, I can get the expected particle tail, this method is found in the advance particle tutorial by Thomas Gisiger.
Code:
		// * manual compute without beam option		
// first compute velocity length
pskill_a = vec_length(pos2.x);

// then compute the number of particles necessary for each frame
pskill_b = ceiling(pskill_a*time_step/(tail_size*tail_p));

// finally the tail is constructed here
pskill_c = 0;

while(pskill_c < pskill_b)
{
tail_position.x = my.x - time_step * pos2.x * (pskill_c/pskill_b-1);
tail_position.y = my.y - time_step * pos2.y * (pskill_c/pskill_b-1);
tail_position.z = my.z - time_step * pos2.z * (pskill_c/pskill_b-1);

effect(tail,1,tail_position.x,nullvector);

pskill_c += 1;
}



Method 2:
But I got very wrong particle if I just pass the velocity to effect with beam option:
Code:
effect(tail,1,my.x,pos2);