Showing image before load

Dear all,

My game creates a lot of custom data. As a result, it takes a LOT of time to save/load games. Process during which the screen is frozen, and my testers are complaining about that.
I'm trying to show a simple "loading" image during the load process. However, as it currently stands, the image only shows AFTER the process is complete. Can anyone help me?

My current code:

Code:
def on_savefile_ok		sprite=Sprite.new		sprite.x=0		sprite.y=0		sprite.z=9999		sprite.bitmap=Cache.picture("loading")				super		if DataManager.load_game(@index)			on_load_success		else			Sound.play_buzzer		end  end
Put the sprite part in:

def pre_terminate

 your code here

 super

end

And remember to add the part that dispose them or they stays in the memory.

 

def terminate

  dispose your sprites here

  super

end



edit: Sorry, just noticed you want it to show after loading screen. try use pre_terminate instead of start
MeowFace,
Thanks a lot for your attention 🙂 Didn't expect anyone to answer so quickly.
I tried what you mentioned, but it did not work 🙁

The complete Scene_Load file as it currently stands:
 

Code:
class Scene_Load < Scene_File  #--------------------------------------------------------------------------  # * Get Help Window Text  #--------------------------------------------------------------------------  def help_window_text    Vocab::LoadMessage  end  #--------------------------------------------------------------------------  # * Get File Index to Select First  #--------------------------------------------------------------------------  def first_savefile_index    DataManager.latest_savefile_index  end  #--------------------------------------------------------------------------  # * Confirm Save File  #--------------------------------------------------------------------------  def on_savefile_ok		sprite=Sprite.new		sprite.x=0		sprite.y=0		sprite.z=9999		sprite.bitmap=Cache.picture("loading")				super		if DataManager.load_game(@index)			on_load_success		else			Sound.play_buzzer		end  end  #--------------------------------------------------------------------------  # * Processing When Load Is Successful  #--------------------------------------------------------------------------  def on_load_success    Sound.play_load    fadeout_all    $game_system.on_after_load    SceneManager.goto(Scene_Map)  endend
pre_terminate and terminate is there in its super class in Scene_Base.

pre_terminate runs before terminate thus allowing you to post a picture to the screen before Graphic.freeze in terminate occurs.

oh, i see the problem now.. lol, my bad. dispose your sprites after super, not before it. 😛
pre_terminate and terminate is there in its super class in Scene_Base.

pre_terminate runs before terminate thus allowing you to post a picture to the screen before Graphic.freeze in terminate occurs.

oh, i see the problem now.. lol, my bad. dispose your sprites after super, not before it. 😛
I see... I tried this:

class Scene_Load < Scene_File def pre_terminate sprite=Sprite.new sprite.x=0 sprite.y=0 sprite.z=9999 sprite.bitmap=Cache.picture("loading") super end #-------------------------------------------------------------------------- # * Get Help Window Text #-------------------------------------------------------------------------- def help_window_text Vocab::LoadMessage end #-------------------------------------------------------------------------- # * Get File Index to Select First #-------------------------------------------------------------------------- def first_savefile_index DataManager.latest_savefile_index end #-------------------------------------------------------------------------- # * Confirm Save File #-------------------------------------------------------------------------- def on_savefile_ok super if DataManager.load_game(@index) on_load_success else Sound.play_buzzer end end #-------------------------------------------------------------------------- # * Processing When Load Is Successful #-------------------------------------------------------------------------- def on_load_success Sound.play_load fadeout_all $game_system.on_after_load SceneManager.goto(Scene_Map) endendTo no avail. The image shows, but after the load is complete :/

What I suspect is that there is no chance for the screen to update between the OK being pressed and the DataManager starting to work. I have no idea how to allow that. Fiber.yeld just kills the game.
For OK being pressed.

It's somewhere in window_base/window_selectable if i remember right.. will have to check the part where they process the handlers.

Graphic.freeze freezes the graphic but everything else keep running, just not showing because graphic is frozen.

.yield pauses the script, normally used with a condition (or it continues to pause)

wait stops everything as far as i can tell.

let me do a small testing with a sample project and i'll see if pre_terminate works.

and are you using any other scripts that modifies save/load scene? if you do, then you might want to add your code there instead.
and are you using any other scripts that modifies save/load scene? if you do, then you might want to add your code there instead.
No, not using any scripts that modify save/load.

And once again, thanks for your time! You're awesome!
I think i got it to work, apparently your 1st approach works, just need a little tinkering.

here's the code, simply put it below Material and above Main:

Code:
class Scene_Load < Scene_File  def show_loading    @spritetr = Sprite.new    @spritetr.bitmap = Cache.title1("Book")    @spritetr.z = 9999    Graphics.freeze  end  def dispose_loadgraphic    @spritetr.dispose if @spritetr  endalias meow_load on_savefile_ok  def on_savefile_ok    show_loading    meow_load    dispose_loadgraphic  endend
I could KISS you for that! Thank you SO MUCH! 
 
Glad to help! And congratulations on your progress! 😉
Is this like a substitute for long waiting test executing? My project has alot of content as well and sometimes takes a while to boot.
Well, this one here simply freezes the screen after the graphic is shown and let the game continues to do the loading behind.

And when the game changes its scene to Scene_Map it unfreeze and refresh the graphic making everything viewable and moving again.

So, in this case, the users has something to.. umm.. watch, before the actual load finishes its job. Thus not feeling much bad about the "time lag" in between loading. 😛

Original thread: https://forums.rpgmakerweb.com/threads/showing-image-before-load.44629/