I am wanting to create some NPCs that move between rooms. Such as a zombie that is chasing the character but will continue to chase when the player goes into a different room. I can have the zombie follow around the player in one room trying to get him in the same room just fine. However once the player goes into a different room is there a way to make the zombie walk into the current room with the same timing/distance that he was away from the player in the previous room. Thanks!
Use the followCharacter command. Please don't forget to read the manual.
I had already tried the follow command but the zombie always follows the exact route the player took. It doesn't always walk toward the player but the path that the player took.
First of all, the FollowCharacter command will make the character follow even into another room, so it's all you should need.
Just play around with the parameters, I'm sure it's possible to make the character move to the player's position instead of following their route.
I assume that some kill event is going to be triggered if the zombie has reached the player, so try
cZombie.FollowCharacter(player, 0, 0);
Since setting eagerness to 0 causes the character to wander around the player after they reached them, you might also want to try ... 0, 1);
Yeah I've tried those parameters with FollowCharacter. The zombie seems to walk to the players original position and went it gets to that position then it picks the players current position to go to and just continues this. I can't seem to get it to "truely" chase after the player. It just follows the positions that the player was at when it reaches a position.
I created some code under "function repeatedly_execute()" that would constantly tell the zombie to move toward the players current location and that works great in the room. Though once I leave the room it doesn't work as theplayer is no longer in the same room. I suppose I can have it setup to use my script while in the room then right before the player leaves the room I can trigger the followcharacter so they it'll follow into the next room. Once the zombie is in the next room I can retrigger my follow script. Though I was hoping for an easier solution.
Just do:
cZombie.ChangeRoom(player.Room);