NPCs move

Started by JpGames, Fri 30/03/2007 22:12:52

Previous topic - Next topic

JpGames

Hi again.

I know i did and answer like this some days ago, but now i have a different trouble

I need move a NPC inmediately to another place in the same room when you look at him. I mind, in the next frame, if it is possible.

I try with changeroom, but it do not work. Then i try with change the NPC to room -1 and then call him back again, but he returns in the same position, even when i called him with new coordinates.

Then i create a new empty room, absolutely walkable. I send the nopc there in the middle to check if the trouble were the non-walkables areas, but when i call him back, he return in the same position again.

This is the script I'm using and do not works:

(character is actually at room 1, coordinates 300,80)
(When you look at character)
cPaisa.ChangeRoom(2,160,100);
SetTimer (1, 80);
(room2 is absolutely empty and full walkable)
(then i call back him again from the repeteadly_execute in the global script
function repeatedly_execute()
  {
   if (IsTimerExpired(1) == 1) {
     cPaisa.ChangeRoom (1, 0, 40+Random(100));
     }
}

But the funny guy returns to room 1 at coordinates 300,80. Im really confused since i believe I'm acting with logical, but i believe i miss something.

Any help is more than welcome

JpGames

EDIT: I finally found the trouble. The NPC is always walking, so i just added this
         
         cPaisa.StopMoving();

         When you look at him and now is working perfect.

SMF spam blocked by CleanTalk