Jump to content
Raizen

cRmGSS - Picture Bug Fix (necessary!)

Recommended Posts

The Bug:

 

What Happens, when a picture is deleted the RMVXAce scripts keep updating them so for almost all computers there is a constant lag, not perceptible by small number of pictures deleted, but when there is ten or more pictures deleted, which is very common on a RPG Maker game, it starts to be very annoying with the freezes and lags.

 

Correcting:

There were 2 members which were trying to fix this, me and JohnBolton, it took some time because there was no error log, but JohnBolton, which has some scripts here found where was the problem. Also special thanks for Gab! which helped us out also, even though it is a very small script, it took some time to find where was the problem.

 

 

 

#==============================================================================
#                           Picture Bug Fix
#------------------------------------------------------------------------------
# Author : Raizen884
# Credits : JohnBolton, Gab!
# Community : www.centrorpgmaker.com
# This script corrects a bug in the default scripts in which pictures continued
# to be updated even after they were erased, which caused lag.
#------------------------------------------------------------------------------
# Place this script above all other scripts in the Materials section.
#==============================================================================
class Sprite_Picture < Sprite
   def update
       super
       if @picture.name != ""
           update_bitmap
           update_origin
           update_position
           update_zoom
           update_other
       else
           self.bitmap.dispose if self.bitmap != nil
       end
   end
end

 

Images: not necessary.

 

Credits: Raizen884, Johnbolton, Gab!

Edited by Raizen884

Share this post


Link to post
Share on other sites

At first I thought this shouldn't be a problem if you do a cache.clear and a gc.start.

 

But after slamming my head out of frustration for 4 straight hours, trying to figure out why the hell is my game dropping by 10 fps whenever we walk, I remembered this scriptlet. It works like awesomely, so thanks guys! I just want to bump this up since this saved my RMing life, literally.

Share this post


Link to post
Share on other sites

#==============================================================================
#			    Picture Bug Fix
#------------------------------------------------------------------------------
# Author : Raizen884
# Credits : JohnBolton, Gab!
# Community : www.centrorpgmaker.com
# This script corrects a bug in the default scripts in which pictures continued
# to be updated even after they were erased, which caused lag.
#------------------------------------------------------------------------------
# Place this script above all other scripts in the Materials section.
#==============================================================================
class Sprite_Picture < Sprite
   def update
       super
       if @picture.name != ""
           update_bitmap
           update_origin
           update_position
           update_zoom
           update_other
       else
           self.bitmap.dispose if self.bitmap != nil
       end
   end
end

 

I recognize that English isn't your first language, so I did you the favor of cleaning up the comments a bit. I also cleaned up the indenting that wasn't quite right. The script works great I'm just anal about things like that. I'm going to be bringing it up with Degica in the beta testing reports so that we can maybe get this fixed permanently.

Share this post


Link to post
Share on other sites

thanks Touchuzzy, yeah, it really isn't my first language, I'll change in the main tópic, all my scripts are in portuguese, but since this was a big mistake by Enterbrain on the script, I thought I needed to share with foreign communities ;)

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

  • Recently Browsing   0 members

    No registered users viewing this page.

×
Top ArrowTop Arrow Highlighted