I did search, and found a method, but my new code doesn't seem to work.
action player_controls()
{
player = my;
c_setminmax(my);
my.scale_x = 1.5;
my.scale_y = 1.5;
my.scale_z = 1.5;
var anim_percent;
VECTOR pointer_coords[3];
VECTOR ground_coords[3];
VECTOR pointer[3];
VECTOR return_value[3];
VECTOR new_temp[3];
camera.tilt = -45;
camera.pan = 90;
while(1)
{
camera.x = my.x;
camera.y = my.y - 800;
camera.z = my.z + 800;
mouse_pos.x = pointer.x;
mouse_pos.y = pointer.y;
pointer_coords.x = mouse_pos.x;
pointer_coords.y = mouse_pos.y;
pointer_coords.z = 0;
vec_for_screen(pointer_coords, camera);
ground_coords.x = mouse_pos.x;
ground_coords.y = mouse_pos.y;
ground_coords.z = 20000;
vec_for_screen(ground_coords, camera);
return_value = c_trace(pointer_coords, ground_coords, IGNORE_ME | IGNORE_PASSABLE);
vec_set (new_temp.x, return_value.x);
vec_sub (new_temp.x, player.x);
vec_to_angle (player.pan, new_temp);
player.tilt = 0;
if(key_w)
{
c_move(my, vector(10 * time_step, 0, 0), nullvector, GLIDE);
ent_animate(my, "run", anim_percent, ANM_CYCLE);
anim_percent += 10 * time_step;
}
if(key_s)
{
c_move(my, vector(-10 * time_step, 0, 0), nullvector, GLIDE);
ent_animate(my, "run", anim_percent, ANM_CYCLE);
anim_percent += 10 * time_step;
}
if(key_w != 1 && key_s != 1)
{
ent_animate(my, "stand", anim_percent, ANM_CYCLE);
anim_percent += 1 * time_step;
}
if(key_a)
{
my.pan += 10 * time_step;
}
if(key_d)
{
my.pan -= 10 * time_step;
}
c_move(my, vector(0, 0, -35 * time_step), nullvector, GLIDE);
wait(1);
}
}
Can anyone tell me why this doesn't work? It is based off of a post in the A7 forum. Any help would be appreciated.
Another thing: Is there any reason i can't get temp to work? I use a WDL file with my screen size information included, and a C file where all of my code is.
-M
Last edited by Memory; 03/18/09 00:34.