2 registered members (TipmyPip, 1 invisible),
18,731
guests, and 7
spiders. |
Key:
Admin,
Global Mod,
Mod
|
|
|
Re: [assist] sword trail ?
[Re: 3run]
#339692
08/28/10 17:44
08/28/10 17:44
|
Joined: May 2009
Posts: 1,816 at my pc (duh)
darkinferno
OP
Serious User
|
OP
Serious User
Joined: May 2009
Posts: 1,816
at my pc (duh)
|
// sword trail effect
//***********************************************************************************************************
ENTITY* trail1;
////////////////
function sw_Trail_ctrl()
{
VECTOR trailpos1;
VECTOR trailpos2;
VECTOR trailpos3;
VECTOR trailpos4;
VECTOR trailpos5;
VECTOR trailpos6;
VECTOR trailpos7;
VECTOR trailpos8;
VECTOR trailpos9;
VECTOR trailpos10;
trail1 = ent_create("trail1mdl.mdl",me.x,NULL);
set(trail1,PASSABLE);
var trail_length = 2; // adjust length of the trails
vec_set(trailpos10,nullvector);
vec_set(trailpos9,nullvector);
vec_set(trailpos8,nullvector);
vec_set(trailpos7,nullvector);
vec_set(trailpos6,nullvector);
vec_set(trailpos5,nullvector);
vec_set(trailpos4,nullvector);
vec_set(trailpos3,nullvector);
vec_set(trailpos2,nullvector);
vec_set(trailpos1,nullvector);
while(1)
{
vec_for_vertex(trailpos2,me,46); // vertex # for top of blade
vec_for_vertex(trailpos1,me,28); // vertex # for bottom of blade
//vec_set(trail1.x,my.x);
vec_lerp(trailpos10,trailpos10,trailpos8,time_step/trail_length);
vec_lerp(trailpos9,trailpos9,trailpos7,time_step/trail_length);
vec_lerp(trailpos8,trailpos8,trailpos6,time_step/trail_length);
vec_lerp(trailpos7,trailpos7,trailpos5,time_step/trail_length);
vec_lerp(trailpos6,trailpos6,trailpos4,time_step/trail_length);
vec_lerp(trailpos5,trailpos5,trailpos3,time_step/trail_length);
vec_lerp(trailpos4,trailpos4,trailpos2,time_step/trail_length);
vec_lerp(trailpos3,trailpos3,trailpos1,time_step/trail_length);
vec_to_mesh(trailpos1,trail1,19);
vec_to_mesh(trailpos2,trail1,20);
vec_to_mesh(trailpos3,trail1,17);
vec_to_mesh(trailpos4,trail1,18);
vec_to_mesh(trailpos5,trail1,16);
vec_to_mesh(trailpos6,trail1,15);
vec_to_mesh(trailpos7,trail1,13);
vec_to_mesh(trailpos8,trail1,14);
vec_to_mesh(trailpos9,trail1,12);
vec_to_mesh(trailpos10,trail1,11);
vec_to_mesh(trailpos1,trail1,2);
vec_to_mesh(trailpos2,trail1,1);
vec_to_mesh(trailpos3,trail1,4);
vec_to_mesh(trailpos4,trail1,3);
vec_to_mesh(trailpos5,trail1,5);
vec_to_mesh(trailpos6,trail1,6);
vec_to_mesh(trailpos7,trail1,8);
vec_to_mesh(trailpos8,trail1,7);
vec_to_mesh(trailpos9,trail1,9);
vec_to_mesh(trailpos10,trail1,10);
wait(1);
}
}
lol am no noob =P anyways, i made a function sw_Trail_ctrl and called it from my sword function, as said, i see tha trail.. BUT its at an offset, above the actual sword
|
|
|
Re: [assist] sword trail ?
[Re: darkinferno]
#339695
08/28/10 18:10
08/28/10 18:10
|
Joined: May 2009
Posts: 5,377 Caucasus
3run
Senior Expert
|
Senior Expert
Joined: May 2009
Posts: 5,377
Caucasus
|
I'm just kidding bro Some how I got it to work (some times I even amaze myself  ). If you are using an other sword model, you need to change this two numbers according to your sword model:
vec_for_vertex(trailpos2,me,39); // vertex at the top of the sword
vec_for_vertex(trailpos1,me,9); // vertex at the bottom of the sword
Results... BEFORE: AFTER: I hope, this is what you were looking for 
|
|
|
|