RMMV Scene lifecycle? Where to do clean-up?

ArbalestSD

Villager
Member
Joined
Jun 15, 2020
Messages
19
Reaction score
0
First Language
English
Primarily Uses
RMMV
Hi everyone,
I was wondering, what is the lifecycle of a Scene like?

I wrote a plugin to draw some stuff on screen in Scene_Map. I did that by creating some sprites an adding them to the scene's children. Now menu windows are partially transparent in the game but I do not want the things I draw in the Scene_Map to be seen through the windows of my menus so I would like to remove those children I added to Scene_Map but I don't know where.

At first I tried to pass a reference to the Scene_Map instance into Scene_Menu but as soon as you change scenes the Scene_Map instance's children property turns into an empty array (but I need to modify this array). So I thought maybe there is some function in the scene lifecycle that gets called every time when the game changes out of one scene and into another, and there is such a function. It is called “terminate” but by the time terminate gets called the children array is already empty.

So is there some function that gets called once you change from one scene to another that gets called before the children array gets emptied?
 

ArbalestSD

Villager
Member
Joined
Jun 15, 2020
Messages
19
Reaction score
0
First Language
English
Primarily Uses
RMMV
Found my answer and for future generations here is the very simple solution:

I just have to make ma modifications to children in the terminate function before I call aliased reference to terminate. :rswt
 

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

Latest Threads

Latest Posts

Latest Profile Posts

Couple hours of work. Might use in my game as a secret find or something. Not sure. Fancy though no? :D
Holy stink, where have I been? Well, I started my temporary job this week. So less time to spend on game design... :(
Cartoonier cloud cover that better fits the art style, as well as (slightly) improved blending/fading... fading clouds when there are larger patterns is still somewhat abrupt for some reason.
Do you Find Tilesetting or Looking for Tilesets/Plugins more fun? Personally I like making my tileset for my Game (Cretaceous Park TM) xD
How many parameters is 'too many'??

Forum statistics

Threads
105,868
Messages
1,017,066
Members
137,576
Latest member
SadaSoda
Top