Wow, the code is improving, but acting awfully strange.

So, when the game starts, the monster is standing 30 feet up in the air on the spiral staircase, and if the player walks toward the monster on the bottom ground of the tower to where the monster detects the player by c_scan(), the monster will run down path_001 to the bottom of the tower. The monster will then turn and face the player, and run toward the player. If the player dodges the monster and runs past it, and then runs up the stairs, the monster will run toward node 4 on the bottom of the spiral staircase, but then stop there while jittering between nodes 3 and 4.

At this time, the player has run up the spiral staircase a little ways, turns around, and is looking down at the monster on the tower floor, jittering like it does. While the player looks at the monster, the monster is not moving past node 4. However, when the player walks off the side of the spiral staircase and lands on the tower floor 30 feet below, the monster starts running up the spiral staircase on path_001 PERFECTLY with no jittering!

This is the code that is making this happen:

Code:
action path_setter()
{
   VECTOR vec_next_node;

   path_set(my,"path_001");
	
   if(pathSetNum == 1)
   {
      my.NODE_NEXT=path_nextnode(my,1,1); // SET THE NODE
   }

   if(pathSetNum == 2)
   {	
      my.NODE_NEXT=4; // SET THE NODE
   }

   while(1)
   {
      // PATH NODE DETECTION AND FACING //////////////////////////////////
		
      if(vec_dist(my.x,vec_next_node.x) < 80) 
      {    
         if(pathSetNum == 1) 
         {
            my.NODE_NEXT=path_nextnode(my,my.NODE_NEXT,1); // Grab Next node on 
         }
	 
         if(pathSetNum == 2) 
	 {
	    my.NODE_NEXT-=1; 
               
            if(my.NODE_NEXT < 1)
            {
               my.NODE_NEXT = 1;	
	    }
         }
      }
		
      path_getnode(my,my.NODE_NEXT,vec_next_node,NULL);  
         
      vec_to_angle(my.pan,vec_diff(NULL,vec_next_node,my.x));
         // face the new node

      DEBUG_VAR(my.NODE_NEXT,450);
      DEBUG_VAR(pathSetNum,500);
		
      wait(1);
   }
}

action monster_action() 
{
   ...

   pathSetNum = 1;

   ...
	
   while (1)
   { 
      ...
	   
      if(my.STATE == 1) 
      {	
         my.ANIMATION += 3*time_step;
			
         ent_animate(me,"idle",my.ANIMATION,ANM_CYCLE);	
		
         c_scan(my.x,my.pan,vector(360,0,750),SCAN_ENTS | SCAN_FLAG2 | 
            IGNORE_ME);
			
	 if (you) // player detected?
	 {  
	    path_setter(); // MONSTER RUNS DOWN path_001 SINCE pathSetNum = 1
					
	    ...

	    my.STATE = 2; 
	    
            ...
	 }				
      }
	
      // state 2: turn towards enemy, cast spells /////////////////// 
      if (my.STATE == 2) 
      {				
         if((hero.z > 50) && (hero.z > my.z)) // IF PLAYER IS HIGHER THAN 
                                              //    MONSTER ON STAIRS
	 {
	    pathSetNum = 2;
				
	    my.NODE_NEXT = 4;
	 }

         if((my.z >= 47) && (my.z <= 49))
	 {
	    vec_set(temp.x, player.x);
            vec_sub(temp.x, my.x);
            vec_to_angle(my.pan, temp); // rotate the enemy towards the player
	 }
			
         c_move(my, vector(8 * time_step, 0, 0), nullvector, GLIDE);
         
         ent_animate(my, "run", anim_percentage, ANM_CYCLE);
         anim_percentage += 8 * time_step;

         ...
      }  
		
      ...
		
      wait(1);
   }
}



I tried taking this code out:

Code:
if((my.z >= 47) && (my.z <= 49))
{
   vec_set(temp.x, player.x);
   vec_sub(temp.x, my.x);
   vec_to_angle(my.pan, temp); // rotate the enemy towards the player
}



...thinking it might have been somehow interfering, but the same result happened even after commenting it out.

It is crazy trying to debug this, but fun at the same time. :-)