Originally Posted By: BastovBros
My BEAM trails don't work. I have a model moving on physics, and here is the code I use for the particle trails (modified from the GS sample) :
Code:
function trace_wing2_alpha(PARTICLE *p)
{
    p.alpha -= 0.1*time_step;
    p.size -=0.1*time_step;
    if (p.alpha <= 0) p.lifespan = 0;
}

function trace_wing2(PARTICLE *p)
{
   set(p, BRIGHT|TRANSLUCENT|BEAM);
   p.alpha = 1;
   p.size = 3;
   p.event = trace_wing2_alpha;
}
action fly(){
while(1){
vec_for_vertex(wing_trace2.x,me,2258);			
vec_set(last_pos_wing2.x,wing_trace2.x);
here is forward movement code using physics parameters...
phent_addforcelocal (my, vector(200,0,0),nullvector);	 
effect(trace_wing2,10,wing_trace2.x,vec_sub(last_pos_wing2.x,wing_trace2.x));
wait(1);}
}


This code works for STREAK particles.... but BEAMs are simply not displayed. I think it is because I use engine physics for movement. I have applied the same code for the bullets which movement is based on vectors (e.g. c_move(vector_forward,nullvector, NULL);) Any ideas how to fix this? thx in advance
Hey,

You're overwriting both last_pos_wing2 and wing_trace2 before you're calculating, so the BEAM length will always be 0,

Code:
while(1){
   vec_set(last_pos_wing_trace2.x, wing_trace2.x);
   phent_addforcelocal (my, vector(200,0,0),nullvector);
   vec_for_vertex(wing_trace2.x, me, 2258);
   effect(trace_wing2,10,wing_trace2.x,vec_sub(last_pos_wing2.x,wing_trace2.x));
   wait(1);
}

*SHOULD* hopefully work