Certainly, the endless loop is also in the NPC's script:
#include "scripts\base.inc"
walkAround();
////////////////////////////////////////////////////////////////////////////////
on "LeftClick"
{
this.Reset();
actor.GoTo(this.X, this.Y);
this.GoTo(200, 470); // crash happens here
}
////////////////////////////////////////////////////////////////////////////////
on "Talk"
{
this.Reset();
actor.GoTo(this.X, this.Y);
actor.Talk("Hey there!"); // crash happens before this line appears on screen
this.Talk("Go away!");
walkAround();
}
// LOOP
function walkAround()
{
while (true)
{
this.GoTo(200, 470);
Sleep(5000);
this.GoTo(600, 470);
Sleep(5000);
}
}
My first description was inaccurate, I noticed: In the Talk event the crash happens before the player actor can say "Hey there!", right after "actor.GoTo(this.X, this.Y);". If I remove the line "actor.GoTo(this.X, this.Y);" in the Talk event, the player actor can say her line, and then the crash occurs.
If I comment out "this.Reset();" and "walkAround();" in the Talk event, no crash happens. In this case, however, I can talk to the NPC only once, and then she becomes "inactive" and talking to her or left-clicking on her does nothing (even though her caption still appears when the mouse is over her).