Change_scene_to_file does not work properly

Godot Version

4.3

Question

As brief as possible.
My game is almost finished, refining the details.
I’ve got a loading screen. From it I access to the intro. From the intro to the title screen. From title screen to the character selection. And last from character selection to the game.
All this works fine. I can run the scene loading screen and everything go, or I can start from the intro, or from the title screen, or from the character selection, or straight from the game scene (in which case I get the default character).

All these transitions are obtained through “change_scene_to_file”, and they WORK.

Now. In-game, I want to be able to go back to the title screen. And this does not work. If I change_scene_to_file to the scene with the title screen, the screen becomes black and the intro music start playing, but nothing else happens.
The background is supposed to be black indeed, and the music is the right one, however there should be a lot of other stuff!

This happens whatever my starting point was. It’s driving me mad. Why doesn’t it work.

Also a creepy thing, the background for the in game music does not stop playing. I did stop it before loading the scene:

get_parent().type_background_music = -10
audio.music_for_scene(-10,Vector2i.ZERO) #these parameters mute the music
get_tree().change_scene_to_file("res://scenes/other/title_screen.tscn")

but the music continues.
It’s creepy. What on Earth is happening.

Oh, I also tested trying to go back to the intro.
The screen becomes black as it should.
Intro music starts playing.
The other music continues, gross.
And there should be some text shown gradually. Nope. Only the first letter shows up. And no key works. From the intro, pressing ESC you should be able to go straight to the title screen. Which is the case if I run the intro from the beginning, but not if i do it from in game

Finally, if I try reloading the loading screen, the very first scene that is, it loads the image, showining it immediately (it should appear smoothly), and freezes. Stays there forever.

Well, I found it.
It seems like this forum is more like a solipsistic vent of mine, but whatever :smiley:
I write it 'cause it might be the word of wisdom for the future, also for other users:

always check process mode LOL.
I had created the title scene without setting process mode (so it was “inherit”) because, well, it’s the damn title scene, who is gonna pause it right? (there’s no option to do it in it).

BUT

ingame, when you open the option menu for all stuff (load, save, configure control etc), the game gets PAUSED, why? Well because it is useful to do so (say you want to load when mobs are attacking, ok you could pause AND open menu, but think about it, 99% of the times if you open the menu you don’t want game events to interfere so it was, and still is, a good idea to pause everything)

So the worflow had me to pause everything and it turns out that this state is inherited when you switch scene.
But the music started, why?
Because it was in the _ready function not in process!

That was driving me crazy! :smiley: