try this,


action pushable_box
{
my.enable_impact=on;
my.event=push_box;
}

function push_box()
{my.event=null;
var box_movement;
while (vec_dist (player.x, my.x) < 200)
{
if (vec_dist (player.x, my.x) < 50)
{
box_movement.x = 10 * cos(player.pan) * time;
box_movement.y = 10 * sin(player.pan) * time;
vec_set (temp, my.x);
temp.z -= 2000;
trace_mode = ignore_me +ignore_passable + use_box;
box_movement.z = -trace(my.x, temp);
move_mode = IGNORE_ME +IGNORE_YOU +ignore_passable+ GLIDE;
ent_move(box_movement, nullvector);
//c_move (my, box_movement, nullvector, ignore_you | ignore_passable | glide);
}
wait (1);
}

my.event=push_box;
}

i added a function to push the box so that your box action does not need a while
loop running constantly eating up valuable memory , i tested this with ent_move
instead of c_move but im sure it will work just as well with c_move just get
rid of my move_mode and ent move lines and uncomment c_move again if c_move is
what you want, but like i said i tested it and i think its much smoother and less jittery

cheers



and yes kasimir is right proc_kill(4) definitly smart to do or null box event
on impact and restore at end of while loop to ensure only one instance of this
function is running

Last edited by badapple; 01/20/08 12:52.