RGSS3 - I can't find menu to map transition

gudtavosky

Villager
Member
Joined
Feb 14, 2016
Messages
7
Reaction score
0
First Language
br portuguese
Primarily Uses
when you open the menu, the screen blurs and the menu opens with an opacity animation, and when you close, it softly vanishes

where can I find that transition from the menu to the map when you press cancel?

I ask this because I'm making a custom menu where each character has its own status window, instead of a single status window for everyone, and in the Scene_Menu script, I changed the @status_window variable to an array of windows. It works great, until I close the menu, where all the status windows have no fade out animation before completely vanishing. If I set any of the windows to any variable with any name, it suddenly works again, but I can't figure out why. I think I need to change the transition script to fade out arrays too, but I can't find it anywhere in the whole game code
 

Attachments

TheoAllen

Self-proclaimed jack of all trades
Veteran
Joined
Mar 16, 2012
Messages
4,646
Reaction score
5,294
First Language
Indonesian
Primarily Uses
RMVXA
This is a common mistake to anyone who start to script custom scene and handle windows in array or any form that is not window object. You have to know that every windows (in RGSS3, former RGSS version didn't do this) disposed automatically when the scene changes.

The method in question is on scene base line 101
Code:
  def dispose_all_windows
    instance_variables.each do |varname|
      ivar = instance_variable_get(varname)
      ivar.dispose if ivar.is_a?(Window)
    end
  end
This particular method checks every instance variable that is a window, then disposes it when the scene changes. If you handle your windows in an array, it will miss the check. To solve this problem you have to manually dispose your windows through the terminate methods

For example, your window is stored in an array named @status_array
Code:
  alias edited_menu terminate
  def terminate
    edited_menu
    @status_array.each {|window| window.dispose}
  end
Also worth noting:
Disposing windows and sprites is important, because once the object loses its pointer (e.g, change the scene), it won't be disposed automatically, leaves the game bloated with unused memory slot (idk the actual technical term), which later leads to "RGSS stopped working" error.
 

gudtavosky

Villager
Member
Joined
Feb 14, 2016
Messages
7
Reaction score
0
First Language
br portuguese
Primarily Uses
Thank you so much! Thats exactly what I was looking for. And I do have other memory leaks in other projects, where I use scenes to show pictures (had the same problem with the non fading transition), but now Im going to fix all that!

Thanks again for the great answer!
 

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

Latest Threads

Latest Posts

Latest Profile Posts

redrawing one of three my VNM protags
I'm making my game in both English and Portuguese. I wonder if I should add Spanish too? :v
Thinking about picking up Luna Engine, but also wondering if I should wait to see if it goes on sale.
So looks like the last Star Wars movie sucked. We feared George would kill his own legacy after Episode 1. But look like he handed off to others to put it out of its misery. Does that count as assisted suicide?
Brother made thumbnails for my Lets Plays. He's a swood dude.

Forum statistics

Threads
93,704
Messages
914,807
Members
123,310
Latest member
magicvampire582
Top