I've got a dialog where I want a character to change SpeechView frequently, and has a few incidental animations (most notably a sort of shocked reaction) I am initiating using LockView followed by Animate, with code in the room to UnlockView when the animation has completed.
The incidental animation works great any number of times until I change the SpeechView (either through the Character.SpeechView or Set-Speech-view commands) at which point it doesn't trigger properly.
I can't figure out how to work around this.
I have some examples of my code here:
First an example of how I'm calling the incidental surprised animation from the Dialog script.
Code: ags
When the animation completes, it returns to the previous view due to this code in the room.
Code: ags
However, once the dialog passes any point where the SpeechView is changed, this stops working. It continues playing the SpeechView until no characters are speaking, then goes to the first frame of the locked view. It returns to the SpeechView when the character speaks but keeps returning to the locked view after, and the view seems stuck on the first frame. I can't figure out where the error is.
Are there limitations to changing SpeechView in the midst of a Dialog, or any other thoughts as to why this may be happening?
The incidental animation works great any number of times until I change the SpeechView (either through the Character.SpeechView or Set-Speech-view commands) at which point it doesn't trigger properly.
I can't figure out how to work around this.
I have some examples of my code here:
First an example of how I'm calling the incidental surprised animation from the Dialog script.
cEgo: If you left when you said you did, not only had the drum not fallen yet, but you couldn't have even been here when it did!
cSkitt.LockView(20);
cSkitt.Animate(0,2,eOnce,eNoBlock);
cSkitt: Waaaaaaaah!
cEgo: We know that the drum fell between Eden leaving last night and returning today.
When the animation completes, it returns to the previous view due to this code in the room.
function repeatedly_execute_always()
{
if (!cSkitt.Animating && (cSkitt.View == 20) && (cSkitt.Frame == 8))
{
cSkitt.UnlockView();
}
}
However, once the dialog passes any point where the SpeechView is changed, this stops working. It continues playing the SpeechView until no characters are speaking, then goes to the first frame of the locked view. It returns to the SpeechView when the character speaks but keeps returning to the locked view after, and the view seems stuck on the first frame. I can't figure out where the error is.
Are there limitations to changing SpeechView in the midst of a Dialog, or any other thoughts as to why this may be happening?