This was the original cat sliding code, but I ditched it for the physics engine. No point in keeping it, maybe somebody with a lower edition will get some use from it. You'll need to set the entities skills 1-3 or just adjust the code.
Code:
action cat2
{
var force_abs[3];
var dist[3];
var accel;
var force_x;
var force_y;
var keepitsteady;
var rotate_look[3];
var rotate_force;
var rotate_go;
my.cast = off;
accel = 0.1;
my.flag1 = off;
//my.shadow = on;
move_friction = 0;
var min_speed;
var max_speed;
var mouse_accel;
min_speed = my.skill1; //enter properties in wed or change this line
max_speed = my.skill2; //enter properties in wed or change this line
mouse_accel = my.skill3; //enter properties in wed or change this line
while(1)
{
if(my.flag1 == on)
{
force_x += mouse_force.x*mouse_accel;
force_x = max(min_speed, ( min(force_x, max_speed) ));
force_y += mouse_force.y*mouse_accel;
force_y = max(min_speed, ( min(force_y, max_speed) ));
force_abs.x = force_x;
force_abs.y = force_y;
vec_accelerate(dist,force_abs,accel,2);
}
rotate_look.x = my.x+dist.x;
rotate_look.y = my.y+dist.y;
rotate_look.z = my.z;
vec_set(temp,rotate_look.x);
vec_sub(temp,my.x);
vec_to_angle(rotate_look.pan,temp); // now MY looks at YOU
temp = ang(my.pan) - ang(rotate_look.pan);
if (abs(temp) > 180)
{
temp = (360 - abs(temp)) * sign(temp) * (-1);
}
//if(temp < 0) { my.pan += time*2; }
//if(temp > 0) { my.pan -= time*2; }
if(temp > 0) { rotate_force = 0.5; }
if(temp < 0) { rotate_force = -0.5; }
rotate_go += rotate_force * time;
if(rotate_go > 4) { rotate_go = 4; }
if(rotate_go < -4) { rotate_go = -4; }
my.pan += -rotate_go * time;
vec_set(temp, my.x);
temp.z -= 1000;
trace_mode = ignore_models+ignore_sprites;
if(my.flag4 == off) { trace(my.x,temp.x); }
//debugvar3 = result;
if(result > 1)
{
if(dist.z > gravity) { dist.z -= time*0.1; }
my.passable = on;
my.flag1 = off;
my.flag2 = on;
if(result > 300)
{
my.flag4 = on;
}
}
else
{
if(my.flag4 == off)
{
dist.z = 0;
my.flag1 = on;
my.passable = off;
my.flag3 = on;
}
}
if(my.flag4 == on)
{
if(dist.z > gravity) { dist.z -= time*0.1; }
my.passable = on;
if(my.flag5 == off) { ent_create("falltarget.tga",my.x,ownage_point); my.flag5 = on; } // create the green thing
}
if((my.flag2 == on) && (my.flag3 == on))
{
if(my.flag5 == off)
{
ent_create("splat1.tga",my.x,decal_up); // create blood splatter
my.flag3 = off;
my.flag2 = off;
}
}
if(my.flag4 == off)
{
camera.x = my.x;
camera.y = my.y-280;
camera.z = 200;
camera.tilt = -35 + force_y;
camera.roll = -force_x;
}
move_mode = ignore_me + ignore_passable + glide;
result = ent_move(nullvector,dist);
wait(1);
}
}