I currently have a script to have an NPC walk around on a loop:
Code: ags
This works good, but obviously as soon as the character reaches a waypoint he immediately walks to the next one. How can I have him pause, or even insert other things (like dialogs) at certain points during his walkaround?
function room_RepExec()
{
if(cNPC.Moving == false){
cNPC.Walk(300, 124, eNoBlock, eWalkableAreas);
if(cNPC.x>298){ cJack.AddWaypoint(233, 120);}
if(cNPC.x<235){ cJack.AddWaypoint(300, 120);}
}
This works good, but obviously as soon as the character reaches a waypoint he immediately walks to the next one. How can I have him pause, or even insert other things (like dialogs) at certain points during his walkaround?