How would I partake in doing such work. Say I have my normal emiter:
Code:
if(weapon_number==1)//////
{
ent_vertex(temp,765);///vertex shell
CREATE <case.mdl>,temp,Part_shell;
}
Now i got my Shell code where it does the normal random flips out of the case. How could i add physics to this...im thinking on using newtons.
Code:
function Part_Shell()
{
my.passable = on;
my.metal = on;
my.scale_x *= 0.4;
my.scale_y *= 0.4;
my.scale_z *= 0.4;
// throw part
my._speed_x = random(6) - 3;
my._speed_y = random(6) - 3;
my._speed_z = random(3) + 8;
//reset:
my._aspeed_pan = 0 + random(20);
my._aspeed_tilt = 0 + random(70);
my._aspeed_roll = 0;
MY.PAN = YOUR.PAN;
MY.TILT = YOUR.TILT;
//Animate
my.skill9 = 20 + random(50);
while(my.skill9 > -16)
{
move_mode=ignore_models;
abspeed[0] = my._speed_x * time;
abspeed[1] = my._speed_y * time;
abspeed[2] = my._speed_z * time;
my.pan += my._aspeed_pan * time;
my.tilt += my._aspeed_tilt * time;
my.roll += my._aspeed_roll * time;
vec_scale(absdist,movement_scale); // scale absolute distance by movement_scale
move(my,nullvector,abspeed);
if(bounce.z)
{
my._speed_z = -(my._speed_z/2);
if(my._speed_z < 0.25)
{
my._speed_x = 0;
my._speed_y = 0;
my._speed_z = 0;
my._aspeed_pan = 0;
my._aspeed_tilt = 0;
my._aspeed_roll = 0;
}
}
my._speed_z -= 2*time;
my.skill9 -= 1;
//fade out:
my.alpha -= 2*time;
if(my.alpha <=0)
{
//remove
wait(1);
remove(me);
}
wait(1);
}
}
Any ideas...i want it to bounce on ground i can call a sound....and then remove(me);
Thanks.