Particles smile
I need X number of particles to populate a distance from vertex1 to vertex2 on mdl object.
The embarrassing part is that I'm already using that effect through script written by programmer signed as John (FlyingSword.wdl). It's just that I couldn't clone it fast and it should be just a few lines of code. So I thought I ask.

This is the function that I think is responsible for light-effect on sword:

FUNCTION LightSword(){
//"Magic, glowy, sparkly, ooh" effect
vec_for_vertex(PointVec,my,vektor_1); //Sword Point, if you use a different model be sure to change the vertex
Vec_for_vertex(tempvec,my,vektor_2); //Sword Hilt, if you use a different model be sure to change the vertex
BladeLength = vec_dist(PointVec.x,tempvec.x); //My game uses varying sword lengths so I check the length each Time
OrbitPlayerMin=MAX(BladeLength*2,70); //Set the orbitplayer distances based on the sword length
OrbitPlayerMax=MIN(BladeLength*3,80);

vec_diff(tempangle,PointVec.x,tempvec.x); //Set tempangle to point from the hilt to the point
effectcounter = BladeLength/2; //Calculate the number of effects we need to light the sword
vec_normalize(tempangle,2); //normalize(reduce) the distance of tempangle to 2, we add
//tempangle to the last effect position to calculate the
//next effect position

WHILE((effectCounter>0)&&(partix==1))
{
effect(SwordPlasma_effect,2,tempvec,tempvec); //generate a plasma effect along the sword blade
vec_add(tempvec.x,tempangle.x); //calculate the position to generate the next effect
effectcounter -=1; //decrement the effect counter
}
}


@Widi
I will try the code but I believe it's in Lite-C. Will it work if I change it to C-Script(void to function etc.)?


>>Demos free3DModels Tutorials<<
>>>>>>> by Pavle Nikolic <<<<<<<