So, it appears that whatever path is set first allows the monster to move along that path perfectly. Whatever path is set second, the monster is only able to move to the second node (after the initial node), but cannot move past the second node.

For example:

(1) The player enters a tower with a spiral staircase. A monster is standing on a certain location along the spiral staircase, which is not very far off the bottom of the tower, maybe 30 feet by our real standard.

(2) The player moves a certain distance toward the monster. If the monster's c_scan() detects the player, the monster will proceed to run down the "path_001" path, which goes down the spiral staircase to the bottom of the tower.

(3) Once the monster gets to the bottom of the tower, the monster will face and run toward the player.

(4) If the player runs past the monster and tries to escape it by moving up the spiral staircase, this should trigger the monster to start moving up "path_002" (chasing the player up the spiral staircase), whose nodes are on the same points as "path_001", except that "path_002"'s direction is moving up the spiral staircase, not down it as "path_001" does.

(5) Once the monster gets to the second node in "path_002", the monster stops moving.

I have tried reversing "path_001" and "path_002"'s order, to where if the player moves toward the monster in the beginning and the monster's c_scan() is triggered by the player, the monster will run in the air from the location it was on on the spiral staircase (30 feet over the bottom of the tower), toward the start of "path_002" at the bottom of spiral staircase, and then start moving up the staircase. When this happens, the monster moves up "path_002" just fine along all nodes.

If the player chases the monster up the spiral staircase as it moves along "path_002", and runs past it to where the player is higher on the z axis than the monster, the monster will start moving along "path_001" down the spiral staircase, but also will not get past the second node.

Here is my code in trying to make all this happen:

Code:
action monster_action() 
{
   ...
	
   while (1)
   { 
      ...
		
      c_scan(my.x,my.pan,vector(360,0,750),SCAN_ENTS | SCAN_FLAG2 | IGNORE_ME);
			
      if (you) // player detected?
      {  
         pathSetNum = 1;
	
         path_setter();
					
         ...
			
         my.STATE = 2; 	
      }				
   }
	
   if (my.STATE == 2) 
   {				
      if((hero.z > 50) && (hero.z > my.z)) // player is above
         //    bottom of tower, and monster
      {
         pathSetNum = 2;
	 path_setter();
      }
			
      if((my.z >= 47) && (my.z <= 49)) // once on bottom of 
         //    tower, monster faces and runs toward player
      {
         path_set(my,NULL);
				 
         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);
}


...

action path_setter()
{
   VECTOR vec_next_node;

   path_set(my,NULL);
	
   if(pathSetNum == 1) // whatever path is set here works perfectly
   {
      //path_set(my,"path_002");
      path_set(demon,"path_001");
   }
	
   if(pathSetNum == 2) // whatever path is set here does not allow monster to
                       //    move past second node
   {
      //path_set(my,"path_001");
      path_set(demon,"path_002");
   }
	
   my.NODE_NEXT=path_nextnode(my,1,1); // SET THE NODE
	
   while(1)
   {
      // PATH NODE DETECTION AND FACING //////////////////////////////////
		
      if(vec_dist(my.x,vec_next_node.x) < 80) 
      {    
         my.NODE_NEXT=path_nextnode(my,my.NODE_NEXT,1); // Grab Next node on 
                                                        //    path	
      }
		
      path_getnode(my,my.NODE_NEXT,vec_next_node,NULL);  // Get next node actual vector location 
		
      vec_to_angle(my.pan,vec_diff(NULL,vec_next_node,my.x)); // face the new node
		
      wait(1);
   }
}



So, somehow the path that the monster travels after the first path does not allow the monster to move past the second node, but the first path works just fine for the monster, whatever order "path_001" or "path_002" are in.

Anyone have a clue why? Any help would be appreciated. Thank you.

Last edited by Ruben; 11/13/15 02:22.