A multiplayer game with standard autoloaded manager.
Describe the problem or limitation you are having in your project
When running a specific scene from the editor or the command prompt, the scene running is not the home scene set in the project settings. I want the game to detect which scene is about to run as the current scene, execute some code to set up extra things like a single-player test mode, and take over how the scene is put in the scene.
Describe the feature / enhancement and how it helps to overcome the problem or limitation
It allows user to run custom code when a new current_scene is about to added into the tree, and take over how the engine put the new current_scene in the tree.
Describe how your proposal will work, with code, pseudo-code, mock-ups, and/or diagrams
Add a new_current_scene_adding_enabled to set whether the default add_child code for the new current_scene will be run.
And add a few signals in SceneTree such as: new_current_scene_addingnew_current_scene_added to let the autoloaded nodes know it's happening and run custom code.
If this enhancement will not be used often, can it be worked around with a few lines of script?
No, there's no callback when the new current_scene is adding or added. Only a generic node_added signal is present.
Is there a reason why this should be core and not an add-on in the asset library?
This improves how the users can interact with Godot's built-in scene changing and scene loading process.
It allows users to work better with the editor's "run specific scene" feature.
Describe the project you are working on
A multiplayer game with standard autoloaded manager.
Describe the problem or limitation you are having in your project
When running a specific scene from the editor or the command prompt, the scene running is not the home scene set in the project settings. I want the game to detect which scene is about to run as the current scene, execute some code to set up extra things like a single-player test mode, and take over how the scene is put in the scene.
Describe the feature / enhancement and how it helps to overcome the problem or limitation
It allows user to run custom code when a new
current_scene
is about to added into the tree, and take over how the engine put the newcurrent_scene
in the tree.Describe how your proposal will work, with code, pseudo-code, mock-ups, and/or diagrams
Add a
new_current_scene_adding_enabled
to set whether the defaultadd_child
code for the newcurrent_scene
will be run. And add a few signals in SceneTree such as:new_current_scene_adding
new_current_scene_added
to let the autoloaded nodes know it's happening and run custom code.If this enhancement will not be used often, can it be worked around with a few lines of script?
No, there's no callback when the new
current_scene
is adding or added. Only a genericnode_added
signal is present.Is there a reason why this should be core and not an add-on in the asset library?
This improves how the users can interact with Godot's built-in scene changing and scene loading process. It allows users to work better with the editor's "run specific scene" feature.