Hello, I'm attempting to start an animation for $gamePlayer that is intended to prematurely end when a certain condition is met. Requesting the animation is easy enough via requestAnimation(), but no matter what I try I can't seem to find out how to completely cease the animation.
For context, I'm using this for a quick time event script I'm writing that plays an animation when an event triggers it. The game awaits for the player's input during a short period of time. If the input is pressed, a relevant timer and the animation are supposed to stop. The timer I created ends fine, but the animation won't.
So far: I've tried to set $gamePlayer._animationId = 0, call $gamePlayer.endAnimation(), and trying to get the corresponding Sprite_Character for $gamePlayer and reset the _animationSprites array (which is horribly wrong) and none of these stop the animation. I've been trying to pour through the source code myself but I'm stuck since I can only find how the engine requests the animation but not how it gets processed.
For context, I'm using this for a quick time event script I'm writing that plays an animation when an event triggers it. The game awaits for the player's input during a short period of time. If the input is pressed, a relevant timer and the animation are supposed to stop. The timer I created ends fine, but the animation won't.
So far: I've tried to set $gamePlayer._animationId = 0, call $gamePlayer.endAnimation(), and trying to get the corresponding Sprite_Character for $gamePlayer and reset the _animationSprites array (which is horribly wrong) and none of these stop the animation. I've been trying to pour through the source code myself but I'm stuck since I can only find how the engine requests the animation but not how it gets processed.
Code:
Sariel_QuickTimeHandler.prototype.start = function(count){
console.log("QTE Start");
this.timer().start(count * 60);
//show an animation around the $gamePlayer
$gamePlayer.requestAnimation(Sariel.QTE.Params.AnimationId);
}
Sariel_QuickTimeHandler.prototype.stop = function(){
console.log("QTE Stop");
this.timer().stop();
//console.assert(SceneManager._scene == Scene_Map, SceneManager._scene);
//var sprite = SceneManager._scene._spriteset.getSpriteCharacter($gamePlayer);
//sprite._animationSprites = [];
//$gamePlayer._animationId = 0;
//$gamePlayer.endAnimation();
//console.log(`Is Animation playing? ${$gamePlayer.isAnimationPlaying()}`);
}