Okay, so what I am really trying to do is make a monster stand idle on a spiral staircase. If the player gets within a certain distance of the monster, I want the monster to stop standing idle, and follow a path titled "path_000" that I set along the entire spiral staircase from bottom to top.

So far, the monster shows up standing idle on the spiral staircase when the level is loaded. When the player gets within the certain distance of it, triggering the c_scan() function within the monster_code() function, I get this pop-up error stating:

Code:
Error E1513
Script crash in ent_movepath:
OK            Cancel



When I press the OK button, the player just moves forward on its own infinitely without me moving it, until I press the Esc button ending the game.

This is the code I have that is making this happen:

Code:
action monster_code()
{
   ...

   while(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)
      {
         ...

         ent_movepath(me, "path_000", 2, 1+2);

         ...
      }

      ...

      ent_bonerotate(my, "Bip01 Spine1", vector(limit2,limit,limit3));
      
      my.tilt = 0;
      my.roll = 0;

      wait(1);
   }
}



It seems that the monster will move along the path if the ent_movepath() is set before the while(1) loop, but not if the ent_movepath() is set within the while(1) loop. I only want the monster to follow the path if the player triggers its c_scan() function, that is within the while(1) loop. Is this allowed with the ent_movepath() function?

NOTE: The program even acts strangely if I place the ent_movepath() function before the while(1) loop. If I specify where in the level I want the monster to be placed using the ent_create() function, the monster will be there where I specified, before the c_scan() is triggered - to which the monster disappears altogether.

If the ent_movepath() function is before the while(1) loop, the monster will not be where I specified, being totally non-visible. After awhile, the monster shows up coming up from underneath the floor (bottom of the spiral staircase room) where the "path_000" begins, and starts moving up the spiral staircase, along the "path_000" path, from bottom to top. I actually placed the monster a little ways up along the spiral staircase, so how it moves underneath the spiral staircase room is beyond me.

Last edited by Ruben; 10/29/15 22:00.