Hehe...yeah I just finally figured that out. However, with it being in the rest of the script...it still just runs 1 frame of the animation, continues the jump with the standing or walking animation.

I've also been moving it around a little. Now, when I load the level...I can walk/strafe/run...etc....but as soon as I hit key_space, it runs through the animation one time...and then I can't make any other movements. The level isn't crashing (as far as I can tell), but my player movement locks up.

Heres my full code:

Code:
///////////////////////////////
#include <acknex.h>
#include <default.c>
#include <mtlFX.c>

#define STATE     skill1
#define ANIMATION skill2

var jump_percentage;
///////////////////////////////

function main()
{
	//video_screen = 1;
	detail_size = 2;
	level_load("testgame.wmb");

}

function camera_follow(ENTITY* ent)
{
	while(1) 
	{
		vec_set(camera.x,vector(-150,10,50));  // camera position relative to the player      
		vec_rotate(camera.x,ent.pan); // rotate the camera position with the player
		vec_add(camera.x,ent.x);      // add player position
		vec_set(camera.pan,vector(ent.pan,-13,0)); // look in player direction, slighty down      
		wait(1);
	}
}

action aPlayer()
{
	camera_follow(me);
	
	//Parameter
	//var movespeed = 10.0/16.0;
	var movespeed = 15;
	var turnspeed = 13;
	var fallacc = 3.68;
	var jumpacc = 20;
	
	//Temporary
	VECTOR movedir;
	vec_set(movedir, vector(0, 0, 0));
	ANGLE rotdir;
	vec_set(rotdir, vector(0, 0, 0));
	var grounddist;
	
	//determine player height
	c_setminmax(my);
	wait(1);
	var feedheight = -my.min_z;
	
	//adjust bounding box
	my.min_x *= 0.7;
	my.min_y *= 0.8;
	my.min_z = 0;
	my.max_x *= 0.7;
	my.max_y *= 0.8;
	my.max_z *= 0.8;
	
	//start camera funtions
	//updateCam(my);
	
	proc_mode = PROC_EARLY;
	while(1)
	{
		if (!key_cuu & !key_cud)
		{my.STATE = 2;}
		
		if (key_cuu ==1 | key_cud ==1 | key_ctrl ==1 | key_ins ==1)
		{my.STATE = 1;}
		
		if (my.STATE ==1)
		{
			//define key inputs
			movedir.x = (key_cuu-key_cud)*(1+key_shift*2);
			movedir.y = (key_ctrl-key_ins);
			
			//define mouse motion
			//rotdir.pan = -mouse_force.x;
			rotdir.pan = (key_cul-key_cur); 
			
			//calculate speed
			movedir.x *= movespeed*time_step;
			movedir.y *= movespeed*time_step;
			
			//calculate speed of movement
			rotdir.pan *= turnspeed*time_step;
			
			//rotate and move
			vec_add(my.pan, rotdir);
			c_move(my, vector(movedir.x, movedir.y, 0), nullvector, GLIDE|IGNORE_PASSABLE);
			var distance = (key_cuu-key_cud | key_ctrl-key_ins)*15*time_step;
				if (key_cuu ==1 | key_cud ==1) //walk forward-backward
				{
					my.ANIMATION += 1*distance;
					ent_animate(me,"walk",my.ANIMATION,ANM_CYCLE);
				}
				if (key_ctrl ==1 | key_ins ==1) //strafe left-right
				{
					my.ANIMATION += 1*distance;
		      	ent_animate(me,"walk",my.ANIMATION,ANM_CYCLE);
		      }
		      if (key_cuu ==1 & key_ins ==1)
				{
					my.ANIMATION -= 1*distance;
		      	ent_animate(me,"walk",my.ANIMATION,ANM_CYCLE);
		      }
		      if (key_cuu ==1 & key_ctrl ==1)
				{
					my.ANIMATION -= 1*distance;
		      	ent_animate(me,"walk",my.ANIMATION,ANM_CYCLE);
		      }
		      if (key_cud ==1 & key_ins ==1)
				{
					my.ANIMATION -= 1*distance;
		      	ent_animate(me,"walk",my.ANIMATION,ANM_CYCLE);
		      }
		      if (key_cud ==1 & key_ctrl ==1)
				{
					my.ANIMATION -= 1*distance;
		      	ent_animate(me,"walk",my.ANIMATION,ANM_CYCLE);
		      }
      }
      
		
		//check distance to ground
		grounddist = c_trace(my.x, vector(my.x, my.y, my.z-10000), IGNORE_ME|IGNORE_PASSABLE)-feedheight;
		if(grounddist > 0 || movedir.z < 0)
		{
			//gravity acceleration
			movedir.z += fallacc*time_step;
		}else
		{
			movedir.z = 0;
		}
		
		//apply gravity
		my.z -= minv(movedir.z*time_step, grounddist);
		
		if(grounddist-minv(movedir.z*time_step, grounddist) == 0)
		{
			if(key_space == 1)
					{my.STATE = 3;}
					if (my.STATE ==3)
					{
						while (1) 
						{ 
							ent_animate(my,"jump",jump_percentage, 0);
							jump_percentage += 7 * time_step; 
							wait (1); 
						}
					
						if(grounddist-minv(movedir.z*time_step, grounddist) == 0)
							{
							//jump

								movedir.z = -jumpacc;
							}
						
					}


		}
		
		if (my.STATE == 2)
		{
		my.pan += (key_cul-key_cur)*20*time_step; 
		var stand_percentage;
		ent_animate(my,"stand",stand_percentage, ANM_CYCLE);
		stand_percentage += 2 * time_step;
		wait(1);
		}
		
		wait(1);
	}
}




"To one who has faith, no explanation is necessary. To one without faith, no explanation is possible." - St. Thomas Aquinas