It's still stuck on the walk gani even when it's supposed to be idling.
onMovementFinished doesn't appear to be called, even with 8+16
EDIT: Fixed. This works.
NPC Code:
function onCreated()
{
this.showCharacter();
this.curPlayer = findPlayer("Raeiphon");
this.onTimeout();
}
function onTimeout()
{
temp.movex = this.curPlayer.x - x; // x needed to travel to player
temp.movey = this.curPlayer.y - y; // y needed to travel to player
dir = getdir(temp.movex, temp.movey);
if (player.dir == 1) { this.desx = 1.7; this.desy = 1; }
if (player.dir == 0) { this.desx = -1.7; this.desy = 1; }
if (player.dir == 2) { this.desx = 1.7; this.desy = -1.7; }
if (player.dir == 3) { this.desx = -1.7; this.desy = -1.7; }
if (this.curPlayer.x+this.desx!=x) {
this.ani = "walk";
move((temp.movex + this.desx), (temp.movey + this.desy), 1, 8+16);
} else {
this.ani = "idle";
setTimer(.05);
}
}
function onPlayerChats() {
if (player.chat="dismiss") {
destroy();
}
}
function onMovementFinished()
{
this.ani = "idle";
setTimer(.05);