Hello everyone,
I need some help resolving an issue with the following code. Now what I want is to have my NPC (the librarian) randomly walk to various locations and then when he gets to the spot, he needs to perform an animation. I can get it working for the most part but the animation doesn't work when I use the eNoBlock parameter. In other words, the librarian just stands there. Here's the code in the room repeat function:
Code: ags
There are normally 9 locations but for testing purposes, I just have it as 0.
When I do debug and the engine gets to the Animate command it goes and loops around through the GlobalScript repeatable
and doesn't come back to the room repeatable.
If I do the eBlock parameter it works but I can't control Ego.
Thanks.
I need some help resolving an issue with the following code. Now what I want is to have my NPC (the librarian) randomly walk to various locations and then when he gets to the spot, he needs to perform an animation. I can get it working for the most part but the animation doesn't work when I use the eNoBlock parameter. In other words, the librarian just stands there. Here's the code in the room repeat function:
if (TimerStart == true) {
location = Random(0); // Randomize 9 numbers
TimerStart = false; // Stop timer from randomizing
}
if (TimerStart == false) { // If timer is paused then send librarian to location
if (cLibrarian.Moving) {
// If librarian is moving do nothing
} else {
if (location == 0) {
if (Walked == false) {
cLibrarian.Walk(444, 229, eNoBlock, eWalkableAreas);
}
if (cLibrarian.Moving == true) {
return;
} else {
Walked = true;
cLibrarian.FaceDirection(eDirectionRight);
cLibrarian.LockView(39);
cLibrarian.Animate(2, 5, eOnce, eNoBlock, eForwards);
if (cLibrarian.Animating == true) {
return;
} else {
cLibrarian.UnlockView();
Walked = false;
TimerStart = true;
}
}
}
}
}
There are normally 9 locations but for testing purposes, I just have it as 0.
When I do debug and the engine gets to the Animate command it goes and loops around through the GlobalScript repeatable
and doesn't come back to the room repeatable.
If I do the eBlock parameter it works but I can't control Ego.
Thanks.