Show Animation Fix

Engr. Adiktuzmiko

Chemical Engineer, Game Developer, Using BlinkBoy'
Veteran
Joined
May 15, 2012
Messages
14,671
Reaction score
2,993
First Language
Tagalog
Primarily Uses
Overview

So from my own experience + some threads a few months back, the show animation event command (or maybe animations as a whole) works a bit odd when the screen scrolls. The animation scrolls with the screen instead of staying on target, which is weird for non-screen animations.

Script

class Sprite_Base def update_animation return unless animation? #We reset the origin so that it shows correctly set_animation_origin @ani_duration -= 1 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 endendNotesBetter put it above any other script, especially those that might be overwriting the same method.

Terms

Use it if you want, it's a simple "fix"
 

nio kasgami

VampCat
Veteran
Joined
May 21, 2013
Messages
8,600
Reaction score
2,360
First Language
French
Primarily Uses
I think if RMVXACE have soon a update I think they will need to think to put your fix in the next update because it is a really usefull fix! ~

GREAT JOB X3
 
Last edited by a moderator:

tale

Volunteer
Veteran
Joined
Dec 16, 2016
Messages
565
Reaction score
920
First Language
English
Primarily Uses
N/A
Fixed script format, credit Adiktuzmiko.
Code:
class Sprite_Base
  def update_animation
    return unless animation?
    #We reset the origin so that it shows correctly
    set_animation_origin
    @ani_duration -= 1
    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
end
 

Users Who Are Viewing This Thread (Users: 0, Guests: 1)

Latest Threads

Latest Posts

Latest Profile Posts

It's weird I actually have MORE work to do when stuck at home than before.
The No Travel Game Jam is here! Jump in to make a game in the month of April that takes place all in one town!


Decided to take a stab at video editing.... Even made a clickbait screen. I'm so proud of my sellout ways. :LZSexcite:

Forum statistics

Threads
95,470
Messages
929,392
Members
125,711
Latest member
cst
Top