I have a wizard model. If the player gets close enough to the wizard while climbing toward the top of a large spiral staircase, certain code is to be triggered where the wizard will start running down the big spiral staircase along a set path with path nodes.

I got the same path to work for an ogre toward the bottom of the same spiral staircase. The ogre will chase the player no problem up or down the stairs. However, every time the wizard starts moving toward the 1st node of the path, at the very top of the spiral staircase, instead of running straight toward that 1st node, the wizard will first run back and up in the air, before running (floating) in the air toward the 1st path node, kind of like a check mark shape path in the air toward the 1st path node.

I placed a "dummy block model" next to the 1st path node in the level to see if the wizard would move toward the dummy block without the check mark pattern in the air. I programmed it so that the wizard would move and face directly toward the dummy block, and once the wizard's .y location got above 239, the wizard would then travel on the spiral staircase path. The wizard did move directly toward the dummy block without a check mark pattern, but once the wizard started on the path, the wizard did the funny check mark pattern in the air again before starting down the path.

Does anyone know what may be causing the wizard to move in the check mark pattern in the air, as opposed to just running straight toward the first path node on the floor?

Here is my path_setter() function that seems to be making all this happen:

Code:
action path_setter()
{
   proc_kill2(path_setter,my);
   VECTOR vec_next_node;

   VECTOR temp;

   path_set(my,"path_001");

   while(1)
   {
      // PATH NODE DETECTION AND FACING //////////////
		
      if(vec_dist(my.x,vec_next_node.x) < 80) 
      {    
         if(pathSetNum == 1) // pathSetNum = 1 makes 
                             //    entity move down the 
                             //    spiral staircase.
	 {   
	    my.NODE_NEXT+=1; 	             
	 }
		 
	 if(pathSetNum == 2) // pathSetNum = 2 makes 
                             //    entity move up the 
                             //    spiral staircase.
	 {
	    my.NODE_NEXT-=1; 	          
	 }
	         
	 if(my.NODE_NEXT > 247) // if entity is past 
                                //    last node on bottom 
                                //    of staircase, that 
                                //    node is set as 
                                //    my.NODE_NEXT
	 {
	    my.NODE_NEXT = 247;	
	 }
		    	
	 if(my.NODE_NEXT < 1) // if entity is past first 
                              //    node on top of 
                              //    staircase, that node 
                              //    is set as my.NODE_NEXT
	 {
	    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.x, my.x)); // THIS SEEMS TO BE 
                                  //    WHERE THE CHECK 
                                  //    MARK MOVEMENT 
                                  //    PATTERN OCCURS 
                                  //    WITH THE WIZARD?
         // face the new node
         
      wait(1);
   }
}



Anyone have a clue why the wizard is making the check mark pattern when starting on the first path node in "path_001"? Any help would be appreciated. Thank you.

Last edited by Ruben; 05/24/16 03:06.