Ya. I'm looking over it. Gimme a little time to test it. In the meantime here's the code from Grimbar's tuts that works for me. Like I said, it's not mine but it does work.
//player movement functions
var move_vec[3] = 0,0,0;
var idle_percent = 0;
var walk_percent = 0;
var temptilt = 0;
var distance_traced;
var land_percent = 60;
var camstat = 1;
var max_dist = 2;
var cam_point = 0;
var head_height = 20;
//uses: battery, armor, health, ammo, battery_max, armor_max, health_max, ammo_max, falling, fall_distance, jumping, jump_height
action player_move
{
player = me;
my.shadow = on;
my.falling = 0;
camera.genius = me;
wait(1);
shift_sense = 2;
run_weapons();
while (my.health > 0)
{
vec_set(temp,my.x);
temp.z -= 1000;
my.fall_distance = c_trace(my.x, temp, IGNORE_ME|IGNORE_PASSABLE|IGNORE_SPRITES|ACTIVATE_SONAR|SCAN_TEXTURE|USE_BOX);
//check if jumping
if (my.jumping != 0)
{
if ((my.jump_height >32 && my.jumping == 1)||(my.jumping == 2 && my.jump_height > 64))
{
my.jumping = 0;
move_vec.z = 0;
my.jump_height = 0;
}
else
{
if (move_vec.z > 1*time)
{
move_vec.z -= .5*time;
my.jump_height += move_vec.z;
}
else
{
move_vec.z = 1*time;
my.jump_height += move_vec.z;
}
}
}
//check if falling
if (my.fall_distance > 500 && sign(my.fall_distance) != -1 && my.jumping == 0)
{
my.falling = 1;
}
else
{
if (my.fall_distance < 64 && my.falling == 0 && my.jumping == 0)
{
move_vec.z = -my.fall_distance*time;
}
}
if (my.fall_distance > 32)
{
my.falling = 1;
if (move_vec.z > -20*time)
{
move_vec.z -= .5*time;
}
}
if (key_j)
{
if (my.jumping == 0 && my.falling == 0 && my.fall_distance < 1)
{
my.jumping = 1 + key_shift;
move_vec.z = 20*time;
}
}
move_vec[0] = (key_force.y)*8*time;
move_vec[1] = (-key_force.x)*8*time;
player.pan -= (mouse_force.x)*6*time;
c_move(me,move_vec,nullvector,IGNORE_PASSABLE|GLIDE);
player_animate();
handle_camera();
//update_camera();
wait(1);
}
}
//uses: falling, fall_distance
function player_animate()
{
if (my.falling == 1)
{
if (my.fall_distance > 32)
{
ent_animate(me, "jump", 60, anm_add);
}
else
{
if (int(land_percent) != 0)
{
land_percent = (land_percent +8*time)%100;
ent_animate(me, "jump", land_percent, anm_add);
if (my.fall_distance < 0)
{
move_vec.z = -my.fall_distance*time;
}
}
else
{
my.falling = 0;
land_percent = 60;
}
}
}
if (move_vec[0] == 0 && move_vec[1] == 0)
{
idle_percent = (idle_percent +5*time)%100;
ent_animate(me,"idle",idle_percent,ANM_CYCLE);
}
else
{
walk_percent = (walk_percent + sign(move_vec[0])*5*time)%100;
ent_animate(me,"walk",walk_percent,ANM_CYCLE);
}
wait(1);
}
function handle_camera()
{
vec_set(camera.x, player.x);
camera.z += 30;
camera.pan = player.pan;
temptilt +=(mouse_force.y)*6*time;
if (key_home){temptilt=0;}
if(temptilt > 35)
{
temptilt = 35;
}
else
{
if(temptilt < -75)
{
temptilt = -75;
}
}
camera.tilt = 0 + temptilt;
wait(1);
}
function update_camera()
{
vec_set(camera.x, vector(my.x, my.y, my.z+head_height));
if (key_force.y)
{
if (camstat == 1)
{
cam_point+= 1;
if (cam_point>max_dist)
{
camstat = 0;
}
}
else
{
cam_point -= 1;
if (cam_point <(-1*max_dist))
{
camstat = 1;
}
}
camera.z+=cam_point;
}
else
{
cam_point = 0;
}
}