Trying to Advance Battle while Holding the Last Frame of an Animation

I am trying to let the battle advance on the second to last frame of when animations play. I think I got the snippet of code I needed but I am getting stuck coming up with a method or variable to call.

class Scene_Battle < Scene_Base def wait_for_animation update_for_wait update_for_wait until Input.trigger?🙂L) end end endRight now I have it set to that if you press w, it advances the battle. What I had before was:

class Sprite_Base < Sprite def end_animation if Input.trigger?🙂L) dispose_animation else end end Where what would happen was hit w to dispose the last frame of the animation then everything advances.

Ideally, in the end, I want the entire thing to reference a notetag on the skill to decide whether or not to hold the last frame before battle update. I just need some hints on where to go from this, kinda stuck.

EDIT: Actually, I guess a few beers fixes everything.

class Scene_Battle < Scene_Base def wait_for_animation update_for_wait update_for_wait until $advance == 1 $advance = 0 endend class Sprite_Base < Sprite def dispose_animation if @ani_bitmap1 @@_reference_count[@ani_bitmap1] -= 1 if @@_reference_count[@ani_bitmap1] == 0 @ani_bitmap1.dispose end end if @ani_bitmap2 @@_reference_count[@ani_bitmap2] -= 1 if @@_reference_count[@ani_bitmap2] == 0 @ani_bitmap2.dispose end end if @ani_sprites @ani_sprites.each {|sprite| sprite.dispose } @ani_sprites = nil @animation = nil end @ani_bitmap1 = nil @ani_bitmap2 = nil end def update_animation return unless animation? @ani_duration -= 1 if @ani_duration == 1 $advance = 1 end if @ani_duration % @ani_rate == 0 if @ani_duration > 0 frame_index = @animation.frame_max frame_index -= (@ani_duration + @ani_rate - 1) / @ani_rate animation_set_sprites(@animation.frames[frame_index]) @animation.timings.each do |timing| animation_process_timing(timing) if timing.frame == frame_index end else end_animation end end end def end_animation if $combo_window_open == true else dispose_animation end end endI was able to output $advance on the second to last frame of any animation and dispose left over images when the combo window closes with $combo_window_open (had to edit YEA Input Combo Skills).

I am sure there is a tutorial for notetagging somewhere else, guess this is case closed.

Original thread: https://forums.rpgmakerweb.com/threads/trying-to-advance-battle-while-holding-the-last-frame-of-an-animation.16942/